<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3118333704316399201</id><updated>2024-11-01T03:43:31.103-07:00</updated><category term="mysql"/><category term="mysql cluster"/><category term="DBConvert for Oracle and MySQL"/><category term="Error: ‘Access denied for user"/><category term="lost connection to server"/><category term="monitoring"/><category term="query execution"/><category term="replication"/><category term="ALter blocked"/><category term="Aborted connection"/><category term="Ajax"/><category term="Ajax call"/><category term="Alter table syntax"/><category term="Apparent master shutdown"/><category term="Asynchronous JavaScript and XML"/><category term="Can’t get CREATE TABLE"/><category term="Can’t open file"/><category term="Could not parse relay log event entry."/><category term="Duplicate entry for key 1′ on query"/><category term="ERROR 1251: Client does not support authentication protocol"/><category term="Error: log file /mysql/data/mysqld/ib_logfile0 is of different size"/><category term="Failed reading log event"/><category term="Fatal error: Can’t change to run as user ‘mysql’ ; Please check that the user exists"/><category term="Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master when reading data from binary log"/><category term="Got timeout reading communication packets"/><category term="How to find duplicate rows in mysql tables"/><category term="INNODB"/><category term="InnoDB error : Total number of locks exceeds the lock table size"/><category term="Java Ajax"/><category term="MONyog MySQL Monitor and Advisor"/><category term="Maakit"/><category term="Mysql client"/><category term="Mysql features"/><category term="Replication resumed"/><category term="SHOW INNODB STATUS"/><category term="STATUS"/><category term="Slave lag due to Alter"/><category term="Sort Aborted"/><category term="Sort aborted: Out of memory"/><category term="biggest table size in the database"/><category term="cold backup"/><category term="connect_timeout"/><category term="delete duplicate rows in a table"/><category term="different filesystems and it’s limitations"/><category term="duplicate entry"/><category term="duplicate rows"/><category term="engines"/><category term="errno: 145"/><category term="error reading relay log"/><category term="flush privileges"/><category term="full table scan"/><category term="host"/><category term="ib_logfile0"/><category term="ibdata"/><category term="index"/><category term="innodb_log_file_size"/><category term="login"/><category term="max_allowed_packet"/><category term="maximum rows scanned query list"/><category term="monyog"/><category term="mysql cluster feature enhancements"/><category term="mysql cluster features"/><category term="mysql monitoring tools"/><category term="mysql storage engines"/><category term="mysql tools"/><category term="mysql_upgrade"/><category term="mysqldump"/><category term="net_read_timeout"/><category term="old_password"/><category term="password"/><category term="primary key"/><category term="procedure status"/><category term="rename result table"/><category term="replication stopped"/><category term="sql thread"/><category term="storage"/><category term="tables"/><category term="temporary table status of Alter"/><category term="unique key"/><category term="upgrading"/><category term="waiting for table"/><title type='text'>My MySQL Road</title><subtitle type='html'>Do practicals, Learn subject, Share knowledge, Change ....</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-3940956275538633591</id><published>2015-10-05T16:14:00.002-07:00</published><updated>2015-10-13T17:58:36.413-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="delete duplicate rows in a table"/><category scheme="http://www.blogger.com/atom/ns#" term="duplicate rows"/><category scheme="http://www.blogger.com/atom/ns#" term="How to find duplicate rows in mysql tables"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="tables"/><title type='text'>Multiple ways to find duplicates rows and delete safely from bulk number of tables</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
Here comes the scenario, we have a bug in our app which introduced duplicate rows into the table where we don&#39;t have unique key on the table and How do we find and safely delete the duplicate rows &amp;nbsp;and have a copy of rows what we deleted.&lt;br /&gt;
&lt;br /&gt;
Preparing a test setup with scenario, create table, insert some duplicates as below and do a select of rows...&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre style=&quot;color: #632035; overflow: auto;&quot;&gt;&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;CREATE TABLE `test` (
&amp;nbsp; `bid` int(11) NOT NULL AUTO_INCREMENT,
&amp;nbsp; `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
&amp;nbsp; `refid` varchar(255) NOT NULL,
&amp;nbsp; PRIMARY KEY (`bid`),
&amp;nbsp; KEY `addtime` (`addtime`),
&amp;nbsp; KEY `refid` (`refid`)
) ENGINE=InnoDB AUTO_INCREMENT=128 DEFAULT CHARSET=utf8

MariaDB [test]&amp;gt; insert into test(refid) values (&#39;suresh&#39;),(&#39;kumar&#39;),(&#39;kuna&#39;) ;
Query OK, 3 rows affected (0.00 sec)
Records: 3 &amp;nbsp;Duplicates: 0 &amp;nbsp;Warnings: 0

MariaDB [test]&amp;gt; insert into test(refid) values (&#39;suresh&#39;),(&#39;kumar&#39;),(&#39;kuna&#39;) ;
Query OK, 3 rows affected (0.00 sec)
Records: 3 &amp;nbsp;Duplicates: 0 &amp;nbsp;Warnings: 0

MariaDB [test]&amp;gt; insert into test(refid) values (&#39;suresh&#39;),(&#39;kumar&#39;),(&#39;kuna&#39;) ;
Query OK, 3 rows affected (0.00 sec)
Records: 3 &amp;nbsp;Duplicates: 0 &amp;nbsp;Warnings: 0

MariaDB [test]&amp;gt; insert into test(refid) values (&#39;suresh&#39;),(&#39;kumar&#39;),(&#39;kuna&#39;) ;
Query OK, 3 rows affected (0.00 sec)
Records: 3 &amp;nbsp;Duplicates: 0 &amp;nbsp;Warnings: 0

MariaDB [test]&amp;gt; select * from test ;
+-----+---------------------+--------+
| bid | addtime &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | refid &amp;nbsp;|
+-----+---------------------+--------+
| &amp;nbsp;84 | 2015-10-05 14:31:36 | test &amp;nbsp; |
| &amp;nbsp;85 | 2015-10-05 14:31:36 | test1 &amp;nbsp;|
| 113 | 2015-10-05 14:31:50 | suresh |
| 114 | 2015-10-05 14:31:50 | kumar &amp;nbsp;|
| 115 | 2015-10-05 14:31:50 | kuna &amp;nbsp; |
| 116 | 2015-10-05 15:35:39 | suresh |
| 117 | 2015-10-05 15:35:39 | kumar &amp;nbsp;|
| 118 | 2015-10-05 15:35:39 | kuna &amp;nbsp; |
| 119 | 2015-10-05 15:35:40 | suresh |
| 120 | 2015-10-05 15:35:40 | kumar &amp;nbsp;|
| 121 | 2015-10-05 15:35:40 | kuna &amp;nbsp; |
| 122 | 2015-10-05 15:35:40 | suresh |
| 123 | 2015-10-05 15:35:40 | kumar &amp;nbsp;|
| 124 | 2015-10-05 15:35:40 | kuna &amp;nbsp; |
| 125 | 2015-10-05 15:35:41 | suresh |
| 126 | 2015-10-05 15:35:41 | kumar &amp;nbsp;|
| 127 | 2015-10-05 15:35:41 | kuna &amp;nbsp; |
+-----+---------------------+--------+
17 rows in set (0.00 sec)&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Now, we have a table called test with duplicate rows in the table.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We can delete the duplicates in several ways...and the most easier way if we have only one table with few rows to delete is to a simple select with where condition as below and delete using subquery select. Run the delete statement in for loop until we see the zero rows left in the where condition.&lt;br /&gt;
&lt;pre style=&quot;background-color: beige; overflow: auto;&quot;&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre style=&quot;overflow: auto;&quot;&gt;&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;MariaDB [test]&amp;gt; select refid, count(1) from test where addtime between &#39;2015-09-23 00:00:00&#39; and &#39;2015-10-30 00:00:00&#39; group by refid HAVING count(*) &amp;gt; 1;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| refid &amp;nbsp;| count(1) |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| kumar &amp;nbsp;| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| kuna &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| suresh | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;3 rows in set (0.00 sec)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;MariaDB [test]&amp;gt; &amp;nbsp;delete from test where refid in (select * from (select refid &amp;nbsp;from test where addtime between &#39;2015-09-23 00:00:00&#39; and &#39;2015-10-30 00:00:00&#39; group by refid HAVING count(*) &amp;gt; 1 ) a) &amp;nbsp;limit 1 ;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;Query OK, 1 row affected, 2 warnings (0.00 sec)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;MariaDB [test]&amp;gt; select refid, count(1) from test where addtime between &#39;2015-09-23 00:00:00&#39; and &#39;2015-10-30 00:00:00&#39; group by refid HAVING count(*) &amp;gt; 1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| refid &amp;nbsp;| count(1) |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| kumar &amp;nbsp;| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| kuna &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| suresh | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;3 rows in set (0.00 sec)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;MariaDB [test]&amp;gt; delete from test where refid in (select * from (select refid &amp;nbsp;from test where addtime between &#39;2015-09-23 00:00:00&#39; and &#39;2015-10-30 00:00:00&#39; group by refid HAVING count(*) &amp;gt; 1 ) a) &amp;nbsp;limit 1 ;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;Query OK, 1 row affected, 2 warnings (0.00 sec)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;MariaDB [test]&amp;gt; select refid, count(1) from test where addtime between &#39;2015-09-23 00:00:00&#39; and &#39;2015-10-30 00:00:00&#39; group by refid HAVING count(*) &amp;gt; 1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| refid &amp;nbsp;| count(1) |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| kumar &amp;nbsp;| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| kuna &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| suresh | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;3 rows in set (0.00 sec)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;MariaDB [test]&amp;gt; delete from test where refid in (select * from (select refid &amp;nbsp;from test where addtime between &#39;2015-09-23 00:00:00&#39; and &#39;2015-10-30 00:00:00&#39; group by refid HAVING count(*) &amp;gt; 1 ) a) &amp;nbsp;limit 1 ;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;Query OK, 1 row affected, 2 warnings (0.01 sec)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;MariaDB [test]&amp;gt; select refid, count(1) from test where addtime between &#39;2015-09-23 00:00:00&#39; and &#39;2015-10-30 00:00:00&#39; group by refid HAVING count(*) &amp;gt; 1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| refid &amp;nbsp;| count(1) |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| kumar &amp;nbsp;| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| kuna &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;| suresh | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 |&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;+--------+----------+&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #6aa84f;&quot;&gt;3 rows in set (0.00 sec)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
Now, the interesting part. Let&#39;s say we have thousands of tables in several databases and we have to delete all the duplicates with less effort and as simple as above or more simpler than above.&lt;br /&gt;
&lt;br /&gt;
For that, we need to have the percona tool called &quot;pt-archiver&quot;. Download the tool on the server where you have the databases &amp;amp; tables which have duplicate and make it runnable or executable file.&lt;br /&gt;
&lt;br /&gt;
Create a new table as same as the table which have duplicates to store the deleted duplicate row ( just in case if we need the data later to compare or to see for some or other reason ). &amp;nbsp;Altered the table and drop the the auto_increament key as we will have duplicates to insert into when we have multiple tables and dropped the primary key.&lt;br /&gt;
&lt;br /&gt;
Finally, use the pt-archiver to store the duplicate rows in a separate table and start deleting from the bunch of tables. Verify the data in the test_duplicates table which has got deleted.&lt;br /&gt;
&lt;br /&gt;
NOTE : Please use the --dry-run before running the pt-archiver to check on what is happening with the created statement.&lt;br /&gt;
&lt;pre style=&quot;background-color: #d0d0d0; overflow: auto;&quot;&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #d0d0d0; overflow: auto;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: beige; overflow: auto;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: beige; overflow: auto;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: beige; overflow: auto;&quot;&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;wget percona.com/get/pt-archiver&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;chmod +x pt-archiver&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #93c47d;&quot;&gt;create table test_duplicates like test ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #93c47d;&quot;&gt;alter table test_duplicates modify bid int(11) NOT NULL ;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #93c47d;&quot;&gt;alter table test_duplicates drop primary key ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #93c47d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #93c47d;&quot;&gt;* Inserted a bunch of rows again into the table and executing the pt-archiver.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #93c47d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #93c47d;&quot;&gt;for i in `mysql -u root -pxxxx test -s -N -e &quot;show tables like &#39;test%&#39;;&quot;`&amp;nbsp; ; do /root/pt-archiver&amp;nbsp; --source h=localhost,D=test,t=$i,u=root,p=xxxx --dest D=test,t=test_duplicates --where &quot; refid in (select max(refid) from $i where addtime between &#39;2015-09-23 00:00:00&#39; and &#39;2015-10-30 00:00:00&#39; group by refid HAVING count(*) &amp;gt; 1 ) &quot; --purge --no-check-columns --no-check-charset --limit=1 --commit-each --statistics --progress=1&amp;nbsp; ; done&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #93c47d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;TIME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ELAPSED &amp;nbsp; COUNT&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;11&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;13&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;14&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;16&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;17&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;18&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;19&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;21&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;22&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;23&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;24&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;25&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;26&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;27&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;28&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;29&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;31&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;32&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;2015-10-05T14:35:35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;32&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;Started at 2015-10-05T14:35:35, ended at 2015-10-05T14:35:35&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;Source: D=test,h=localhost,p=...,t=test,u=root&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;Dest: &amp;nbsp; D=test,h=localhost,p=...,t=test5,u=root&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;SELECT 32&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;INSERT 32&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;DELETE 32&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;Action &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Count &amp;nbsp; &amp;nbsp; &amp;nbsp; Time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Pct&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;select &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;33 &amp;nbsp; &amp;nbsp; 0.0150 &amp;nbsp; &amp;nbsp; &amp;nbsp;37.79&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;commit &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;66 &amp;nbsp; &amp;nbsp; 0.0075 &amp;nbsp; &amp;nbsp; &amp;nbsp;18.95&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;deleting &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;32 &amp;nbsp; &amp;nbsp; 0.0058 &amp;nbsp; &amp;nbsp; &amp;nbsp;14.56&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;inserting &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 32 &amp;nbsp; &amp;nbsp; 0.0057 &amp;nbsp; &amp;nbsp; &amp;nbsp;14.32&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;other &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; 0.0057 &amp;nbsp; &amp;nbsp; &amp;nbsp;14.37&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;MariaDB [test]&amp;gt; select * from test_duplicates limit 32 ;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;+-----+---------------------+--------+&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| bid | addtime &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | refid &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;+-----+---------------------+--------+&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp; 1 | 2015-10-05 12:13:25 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp; 2 | 2015-10-05 12:13:25 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp; 3 | 2015-10-05 12:13:25 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp; 4 | 2015-10-05 12:13:28 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp; 5 | 2015-10-05 12:13:28 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp; 6 | 2015-10-05 12:13:28 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp; 7 | 2015-10-05 12:13:29 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp; 8 | 2015-10-05 12:13:29 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp; 9 | 2015-10-05 12:13:29 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;10 | 2015-10-05 12:13:29 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;11 | 2015-10-05 12:13:29 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;12 | 2015-10-05 12:13:29 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;13 | 2015-10-05 12:13:30 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;14 | 2015-10-05 12:13:30 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;15 | 2015-10-05 12:13:30 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;16 | 2015-10-05 12:13:31 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;17 | 2015-10-05 12:13:31 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;18 | 2015-10-05 12:13:31 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;19 | 2015-10-05 12:13:31 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;20 | 2015-10-05 12:13:31 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;21 | 2015-10-05 12:13:31 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;22 | 2015-10-05 12:13:32 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;23 | 2015-10-05 12:13:32 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;24 | 2015-10-05 12:13:32 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;25 | 2015-10-05 12:13:32 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;26 | 2015-10-05 12:13:32 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;27 | 2015-10-05 12:13:32 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;28 | 2015-10-05 12:13:33 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;29 | 2015-10-05 12:13:33 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;30 | 2015-10-05 12:13:33 | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;31 | 2015-10-05 12:13:33 | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| &amp;nbsp;32 | 2015-10-05 12:13:33 | kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;+-----+---------------------+--------+&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;32 rows in set (0.00 sec)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;MariaDB [test]&amp;gt; select * from test;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;+-----+---------------------+--------+&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| bid | addtime &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | refid &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;+-----+---------------------+--------+&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| 33 | 2015-10-05 XX:XX:XX | suresh |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| 34 | 2015-10-05&amp;nbsp;XX:XX:XX&amp;nbsp;| kumar &amp;nbsp;|&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;| 35 | 2015-10-05 XX:XX:XX | kuna &amp;nbsp; |&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;+-----+---------------------+--------+&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #93c47d;&quot;&gt;5 rows in set (0.00 sec)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, we have all the duplicates deleted from all the tables. The process with take time as per your number of tables and duplicates. It does take really very long time....&lt;br /&gt;
&lt;br /&gt;
Due to the time contraint and with some options available in hand, started looking for another option. &amp;nbsp;Select the duplicates from all the tables and insert into a second table with the table name and then do a delete.&lt;br /&gt;
&lt;br /&gt;
Create a table with additional column tablename, with out primary keys or unique keys.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #6aa84f;&quot;&gt;create table test5 (&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #6aa84f;&quot;&gt;&amp;nbsp; `bid` int(11) NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #6aa84f;&quot;&gt;`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #6aa84f;&quot;&gt;&amp;nbsp; `refid` varchar(255) NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #6aa84f;&quot;&gt;&amp;nbsp; `tablename` varchar(255) NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #6aa84f;&quot;&gt;&amp;nbsp; KEY `addtime` (`addtime`),&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #6aa84f;&quot;&gt;&amp;nbsp; KEY `refid` (`refid`)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #6aa84f;&quot;&gt;) ENGINE=InnoDB&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;For a bunch of tables with duplicate rows, let&#39;s use s simple for loop to select and insert the duplicates into second table and then do a delete with join.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;







&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot; style=&quot;background-color: #6aa84f;&quot;&gt;&amp;nbsp;for i in `mysql -u root -proot test -s -N -e &quot; show tables like &#39;test%&#39;;&quot;` ; do `mysql -u root -pxxxx test -e &quot;insert into test1.test5(bid,addtime,refid,tablename) select&amp;nbsp; bid,addtime,refid,&#39;$i&#39; from $i where addtime between &#39;2015-09-23 00:00:00&#39; and &#39;2015-10-11 00:00:00&#39; group by refid HAVING count(*) &amp;gt; 1 ;&amp;nbsp; select sleep(1) ;&amp;nbsp; delete $i from $i inner join test1.test5 b on $i.refid=b.refid and $i.addtime=b.addtime and $i.bid=b.bid where 1=1 ; ” ` ; done&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
This one worked pretty well and we will have the backup of deleted rows. Go ahead and try...&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/3940956275538633591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2015/10/how-to-find-duplicates-rows-and-delete_5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3940956275538633591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3940956275538633591'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2015/10/how-to-find-duplicates-rows-and-delete_5.html' title='Multiple ways to find duplicates rows and delete safely from bulk number of tables'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-1371532821562474536</id><published>2012-01-23T02:26:00.000-08:00</published><updated>2015-10-05T16:34:30.297-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cold backup"/><category scheme="http://www.blogger.com/atom/ns#" term="duplicate entry"/><category scheme="http://www.blogger.com/atom/ns#" term="replication stopped"/><title type='text'>Replication stopped with duplicate entry upon starting up of MySQL from cold backup</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
A few days ago, we faced a Duplicate entry problem in the mysqld server on one of our customer’s slave after cold backup.  We do regular data sync checks for all of our customer&#39;s as daily reports and check for data discrepancies between master and slave server&#39;s, if any got picked up by our checks to investigate, and there was no issues for the particular server and with the report. When checked the entry details, there is a row with the same data in the table that was mentioned by Slave status Last_error entity. 

    Quick check on the error log showed that the slave was started after cold back&#39;s and immediately stopped with a duplicate entry error and the mysqld server version is 5.0.77-log Source distribution. From the analysis of the below statements, we found that the slave SQL thread was stopped with the error at a position backwards than the SQL thread initialized after cold backup&#39;s.&lt;br /&gt;
&lt;br /&gt;
[perl]&lt;br /&gt;
[pythian@dol5 ~]$ tail -20 /var/log/mysql/dol5-error.log&lt;br /&gt;
111221 7:42:33 [Note] Slave I/O thread: connected to master &#39;sslrepl@dol50.dollive.com:3306&#39;, replication started in log &#39;dol50-binlog.000763&#39; at position 533765390&lt;br /&gt;
111222 7:05:55 [Note] /usr/libexec/mysqld: Normal shutdown&lt;br /&gt;
111222 7:05:55 [Note] Slave SQL thread exiting, replication stopped in log &#39;dol50-binlog.000767&#39; at position 357198241&lt;br /&gt;
111222 7:05:55 [Note] Slave I/O thread killed while reading event&lt;br /&gt;
111222 7:05:55 [Note] Slave I/O thread exiting, read up to log &#39;dol50-binlog.000767&#39;, position 357511554
111222 7:05:55 InnoDB: Starting shutdown...
111222 7:06:01 InnoDB: Shutdown completed; log sequence number 372 128185461&lt;br /&gt;
111222 7:06:01 [Note] /usr/libexec/mysqld: Shutdown complete&lt;br /&gt;
111222 07:06:02 mysqld ended

111222 07:42:09 mysqld started&lt;br /&gt;
111222 7:42:18 InnoDB: Started; log sequence number 372 128185461&lt;br /&gt;
111222 7:42:20 [Note] /usr/libexec/mysqld: ready for connections.
Version: &#39;5.0.77-log&#39; socket: &#39;/var/lib/mysql/mysql.sock&#39; port: 3306 Source distribution&lt;br /&gt;
111222 7:42:20 [Note] Slave SQL thread initialized, starting replication in log &#39;dol50-binlog.000767&#39; at position 357198241, relay log &#39;/var/lib/mysql/dol50-relay.000066&#39; position: 357198386&lt;br /&gt;
111222 7:42:20 [Note] Slave I/O thread: connected to master &#39;sslrepl@dol50.dollive.com:3306&#39;, replication started in log &#39;dol50-binlog.000767&#39; at position 357511554&lt;br /&gt;
111222 7:42:21 [ERROR] Slave: Error &#39;Duplicate entry &#39;94335&#39; for key 1&#39; on query. Default database: &#39;live&#39;. Query: &#39;insert into charges (amount, key, id) values (0.37, &#39;dlive&#39;, 23892)&#39;, Error_code: 1062&lt;br /&gt;
111222 7:42:21 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with &quot;SLAVE START&quot;. We stopped at log &#39;dol50-binlog.000767&#39; position 357198241&lt;br /&gt;
&lt;br /&gt;
The slave status output on the server that which error occurred is as below.&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; show slave status\G&lt;br /&gt;
*************************** 1. row ***************************&lt;br /&gt;
......
...........&lt;br /&gt;
Last_Errno: 1062&lt;br /&gt;
Last_Error: Error &#39;Duplicate entry &#39;94335&#39; for key 1&#39; on query. Default database: &#39;live&#39;. Query: &#39;insert into charges (amount, key, id) values (0.37, &#39;dlive&#39;, 23892)&#39;&lt;br /&gt;
......
..........&lt;br /&gt;
1 row in set (0.00 sec)&lt;br /&gt;
[/perl]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Another quick check of the transaction details in master binary logs revealed that the transaction involved is the mixture of storage engines InnoDB and MyISAM. At this point, we have understood that the Duplicate entry error was due to the usage of different storage engines for tables involved in a transaction but how the rollback was performed is still a Question and it was not from application used by Customer. Here is the simple example below that shows the rows inserted into MyISAM table couldn&#39;t rolled back though we rollback the transaction.&lt;br /&gt;
&lt;br /&gt;
[perl]&lt;br /&gt;
* Creating a table with MyISAM engine.&lt;br /&gt;
mysql&amp;gt; CREATE TABLE myisam_tbl ( item int, val int ) engine=MyISAM ;&lt;br /&gt;
Query OK, 0 rows affected (0.06 sec)&lt;br /&gt;
&lt;br /&gt;
* Creating a table with Innodb engine.&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; CREATE TABLE innodb_tbl ( item int, val int ) engine=Innodb ;&lt;br /&gt;
Query OK, 0 rows affected (0.02 sec)&lt;br /&gt;
&lt;br /&gt;
* Starting transaction, inserting rows into both tables and issues rollback.&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; START TRANSACTION ;&lt;br /&gt;
Query OK, 0 rows affected (0.06 sec)&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; INSERT INTO myisam_tbl (item, val) VALUES (1, 1), (2, 2);&lt;br /&gt;
Query OK, 2 rows affected (0.02 sec)
Records: 2  Duplicates: 0  Warnings: 0&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; INSERT INTO innodb_tbl (item, val) VALUES (1, 1), (2, 2);&lt;br /&gt;
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; ROLLBACK ;&lt;br /&gt;
Query OK, 0 rows affected, 1 warning (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; show warnings ;
+---------+------+---------------------------------------------------------------+
| Level   | Code | Message |
+---------+------+---------------------------------------------------------------+
| Warning | 1196 | Some non-transactional changed tables couldn&#39;t be rolled back |
+---------+------+---------------------------------------------------------------+
1 row in set (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
* This shows the rows inserted into MyISAM engine table exist and commited.&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; select * from myisam_tbl ;&lt;br /&gt;
+------+------+
| item | val  |
+------+------+&lt;br /&gt;
|    1 |    1 |
|    2 |    2 |&lt;br /&gt;
+------+------+&lt;br /&gt;
2 rows in set (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
* This show the rows inserted into Innodb engine table were not commit-ed.

mysql&amp;gt; select * from innodb_tbl ;
Empty set (0.00 sec)

[/perl]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; We did a check and collected the MyISAM and Innodb tables involved SQL statements in the transaction from binary logs at the position where the slave was stopped with an error. We have deleted all the inserted rows of the MyISAM engine involved in the tables of the transaction manually all at once on the slave server ( which caused the duplicate entry errors ) and started slave, it worked fine and no other error&#39;s found after it. If we delete one of the inserted rows of MyISAM involved tables one at a time and start the slave, then the replication thread will start executing the whole transaction again from the starting position where replay of transaction inserts the previously deleted entry and will stop at the second entry and goes on, it continues in round-robin fashion and the transaction never completes as it executes from the start position of the transaction again when we issue START SLAVE unless we skip the error which skips the complete transaction.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; After a detailed investigation of the incident by another DBA, we found that the cause was determined to be a transaction involving both MyISAM and InnoDB tables, which was rolled backed during MySQL shutdown and was applied again after start-up (this is a normal MySQL behavior). More details on the MySQL server shutdown process can be found &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/server-shutdown.html&quot;&gt;here&lt;/a&gt;  and see point 4 for rollback of SQL thread during shutdown if it is in the middle of transaction. The STOP SLAVE transaction behavior has been fixed in the version 5.1.35 as per change log to avoid the problems encountered in replication for transactional engine stated &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/news-5-1-35.html&quot;&gt;here&lt;/a&gt;, &lt;b&gt;but it was impossible to roll back a mixed-engines transaction when one of the engines was non-transactional, which meant that the slave could not safely re-apply any transaction that had been interrupted by STOP SLAVE&lt;/b&gt;. While changes to InnoDB table were rolled back and then applied normally, changes to MyISAM table couldn&#39;t be rolled-back and were applied twice, as MyISAM is non-transactional engine where every single SQL statement will be committed right after the execution.&lt;br /&gt;
&lt;br /&gt;
We made some recommendations to the Customer as below in which the option 3 was chosen as the slave was dedicated for backup&#39;s and a quick solution applicable for their data set and timeline for resolution of the issue.&lt;br /&gt;
&lt;br /&gt;
1) Change queries or table types to ensure that transactional and non-transactional tables are not mixed in any transaction&lt;br /&gt;
2) Upgrade to MySQL 5.1.35 or later in which the stop slave behavior has been changed to avoid this particular issue ( transaction rollback during MySQL shutdown ).&lt;br /&gt;
3) Consider moving to hot backups which does not require MySQL to be shutdown and always ends at a completed transaction.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/1371532821562474536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2012/01/replication-stopped-with-duplicate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1371532821562474536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1371532821562474536'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2012/01/replication-stopped-with-duplicate.html' title='Replication stopped with duplicate entry upon starting up of MySQL from cold backup'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-1683336318338402485</id><published>2011-08-31T08:01:00.000-07:00</published><updated>2011-08-31T08:01:50.590-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ALter blocked"/><category scheme="http://www.blogger.com/atom/ns#" term="Alter table syntax"/><category scheme="http://www.blogger.com/atom/ns#" term="rename result table"/><category scheme="http://www.blogger.com/atom/ns#" term="Slave lag due to Alter"/><category scheme="http://www.blogger.com/atom/ns#" term="temporary table status of Alter"/><category scheme="http://www.blogger.com/atom/ns#" term="waiting for table"/><title type='text'>Alter waiting on Select statement to complete</title><content type='html'>A few days ago, we faced an interesting problem on one of our customer’s slave mysqld servers.  An Alter for adding a new column was run on master server took 542 seconds where as it took few hours on the slave server to complete due to a SELECT blocking the Alter was not allowed to complete.&lt;br /&gt;
&lt;br /&gt;
Here is the the select on the master server and it’s execution time from the binary logs.&lt;br /&gt;
&lt;pre style=&quot;overflow: auto;background-color: beige&quot;&gt;&lt;span&gt;
# at 825737566
#110720 19:55:21 server id 31415  end_log_pos 825737730         Query   thread_id=83250629      exec_time=542   error_code=0
use collect/*!*/;
SET TIMESTAMP=1311216921/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
ALTER TABLE `track` ADD `source_track_id` int(10) UNSIGNED NULL DEFAULT NULL  AFTER `vendor_track_id`
/*!*/;
&lt;/span&gt;
&lt;/pre&gt;Alter statement completed well on the master and it got blocked by a SELECT on the slave where as the time frames of the threads in the processlist which were executing the Alter and the SELECT resembles the ALTER was started first and then the SELECT next. As per the binary logs on the master the Alter was a single statement by the thread_id and the slave started lagging.&lt;br /&gt;
&lt;pre style=&quot;overflow: auto;background-color: beige&quot;&gt;&lt;span&gt;
mysql&gt; show processlist ;
+---------+-------------+----------------------------+-------------+-------------+--------+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
| Id      | User        | Host                       | db          | Command     | Time   | State                                                          | Info                                                                                                 |
+---------+-------------+----------------------------+-------------+-------------+--------+----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
|     864     | system user |                            | NULL         | Connect     | 479352 | Waiting for master to send event                               | NULL                                                                                                 |
|     865     | system user |                            | collect       | Connect     |   5383 | rename result table                                          | ALTER TABLE `track` ADD `source_track_id` int(10) UNSIGNED NULL DEFAULT NULL  AFTER `vendor_track_id |
| 3277392 | ios               | intreport:56045   | collect       | Query         |   4850 | Copying to tmp table                                       | SELECT /* Reporting Query 357 */
fdr.service_provider_code AS &#39;Provider&#39;,
fdr.service_provider_count |
| 3279284 | uios             | solr02:47871       | collect       | Query         |   4503 | Waiting for table                                              | select track_id,
vendor_track_id,
track_name,
if(promo = &#39;Y&#39;, &#39;true&#39;, &#39;false&#39;) as promo_track,
if( |
.........
.........
 
 Seconds_Behind_Master: 5131
&lt;/span&gt;
&lt;/pre&gt;We did the possible checks to find the status of the Alter and why is it waiting at the RENAME RESULT TABLE to complete. The file level checks shows that the creation of the temp table for Alter was completed while ago.&lt;br /&gt;
&lt;pre style=&quot;overflow: auto;background-color: beige&quot;&gt;&lt;span&gt;
pythian@db04:~$ ls -ltr /ssd2/mysql/collect/track.*
-rwxr-xr-x 1 mysql mysql      19153 2011-07-15 06:11 /ssd2/mysql/collect/track.frm
-rwxr-xr-x 1 mysql mysql       8980 2011-07-15 06:11 /ssd2/mysql/collect/track.TRG
-rwxr-xr-x 1 mysql mysql 2646605824 2011-07-20 20:40 /ssd2/mysql/collect/track.ibd
 
pythian@db04:~$ ls -ltr /mysql/data/collect/track.*
lrwxrwxrwx 1 mysql mysql 26 2011-07-15 08:08 /mysql/data/collect/track.TRG -&gt; /ssd2/mysql/collect/track.TRG
lrwxrwxrwx 1 mysql mysql 26 2011-07-15 08:08 /mysql/data/collect/track.ibd -&gt; /ssd2/mysql/collect/track.ibd
lrwxrwxrwx 1 mysql mysql 26 2011-07-15 08:08 /mysql/data/collect/track.frm -&gt; /ssd2/mysql/collect/track.frm
 
pythian@db04:~$ ls -ltr /mysql/data/collect/*#*
-rwxr-xr-x 1 mysql mysql      19205 2011-07-20 20:04 /mysql/data/collect/#sql-7130_361.frm
-rwxr-xr-x 1 mysql mysql 2499805184 2011-07-20 20:23 /mysql/data/collect/#sql-7130_361.ibd
 
pythian@db04:~$ date
Wed Jul 20 22:13:27 PDT 2011
&lt;/span&gt;
&lt;/pre&gt;The show engine innodb status shows that the Alter was not started yet though it was started, created the temp table and waiting at the the RENAME TABLE operation. The SELECT query which is ACTIVE for 9168 seconds blocked the Alter statement and not allowing it to complete.&lt;br /&gt;
&lt;pre style=&quot;overflow: auto;background-color: beige&quot;&gt;&lt;span&gt;

---TRANSACTION 379ED1F1F, not started, process no 28976, OS thread id 1259583824
mysql tables in use 1, locked 2
MySQL thread id 865, query id 221087068 rename result table
ALTER TABLE `track` ADD `source_track_id` int(10) UNSIGNED NULL DEFAULT NULL  AFTER `vendor_track_id`
---TRANSACTION 379ED1883, ACTIVE 9168 sec, process no 28976, OS thread id 1279453520 fetching rows, thread declared inside InnoDB 49
mysql tables in use 8, locked 0
MySQL thread id 3277392, query id 221086895 intreport 10.1.4.151 collect Copying to tmp table
SELECT /* Reporting Query 357 */
fdr.service_provider_code AS &#39;Provider&#39;,
&lt;/span&gt;
&lt;/pre&gt;A few guesses from mates saying that&lt;br /&gt;
&lt;br /&gt;
1) The select has been started first so it is blocking Alter. ( Not true in this case )&lt;br /&gt;
2) ALTER started first and before it completes, SELECT fires, fast index creation of secondary indexes allows concurrent SELECTS but still has to get global lock during RENAME as per the explanation in docs in &lt;a href=&quot;http://dev.mysql.com/doc/innodb/1.1/en/innodb-create-index-concurrency.html&quot;&gt;this blog post&lt;/a&gt;. But the Alter in this case is not a secondary index rebuild.&lt;br /&gt;
&lt;br /&gt;
A little more digging into documentation revealed that ALTER TABLE makes a temporary copy of the original table. MySQL waits for other operations that are modifying the table, then proceeds. It incorporates the alteration into the copy, deletes the original table, and renames the new one. While ALTER TABLE is executing, the original table is readable by other sessions, but at the end ALTER still has to acquire global lock on data dictionary to swap original and new table copies, that is why we could see other threads in “Waiting for table” state. Updates and writes to the table that begin after the ALTER TABLE operation begins are stalled until the new table is ready, then are automatically redirected to the new table without any failed updates. So what happened in this situation was: ALTER started first, then concurrent SELECT started on the same table, when ALTER finished copy to a temp table it tried to RENAME table, but failed to get global lock on data dictionary. All the threads that started after this point had to wait on ALTER to finish.&lt;br /&gt;
&lt;br /&gt;
More details on the Alter operation can be found &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/alter-table.html&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/1683336318338402485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2011/08/alter-waiting-on-select-statement-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1683336318338402485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1683336318338402485'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2011/08/alter-waiting-on-select-statement-to.html' title='Alter waiting on Select statement to complete'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-1147522457655091667</id><published>2011-06-20T23:15:00.000-07:00</published><updated>2011-06-20T23:16:11.326-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="biggest table size in the database"/><category scheme="http://www.blogger.com/atom/ns#" term="different filesystems and it’s limitations"/><category scheme="http://www.blogger.com/atom/ns#" term="maximum rows scanned query list"/><category scheme="http://www.blogger.com/atom/ns#" term="Sort Aborted"/><category scheme="http://www.blogger.com/atom/ns#" term="Sort aborted: Out of memory"/><title type='text'>Investigating Sort aborted issues</title><content type='html'>A few days ago, I and few of my fellow members had a discussion about the &quot;Sort aborted&quot; error in the error log should be monitored or it can be ignored because it doesn&#39;t bring any value by alerting the oncall DBA who checks the machine and mysqld server status when the error appears.&lt;br /&gt;
&lt;br /&gt;
We have identified the possible or known causes of this error were &lt;br /&gt;
&lt;br /&gt;
1) It could be generated when &lt;br /&gt;
a) users cancelling or killing queries in the middle of a filesort &lt;br /&gt;
b) web servers rebooting while some queries were sorting i.e when the connection to the database drops suddenly &lt;br /&gt;
2) Another is lack of sufficient temp disk space in the tmpdir prevented tmpfile from being created for queries to execute. &lt;br /&gt;
&lt;br /&gt;
As a DBA, we can&#39;t do much with the first point apart from informing customer to check at the application side for connection drop outs.&lt;br /&gt;
The answer for the second point is to change tmpdir in the mysql to point to a directory (a new one, just for this purpose) in the biggest file system.&lt;br /&gt;
&lt;br /&gt;
3) a transaction got rolled back or aborted due to lock wait timeout or deadlock.&lt;br /&gt;
&lt;br /&gt;
In a database, a deadlock is a situation in which two or more transactions are waiting for one another to give up locks.&lt;br /&gt;
Even if a transaction is not involved in a deadlock, it might have to wait a considerable amount of time to obtain a lock because of a long-running transaction or transactions holding locks on the tables it needs. In such a situation, you might not want a transaction to wait indefinitely. Instead, you might want the waiting transaction to abort, or time out, after a reasonable amount of time, called a lock wait timeout.&lt;br /&gt;
&lt;br /&gt;
In such cases, we have to increase the innodb_lock_wait_timeout value in the database server if we want the transaction to wait for more time and complete. We can find the deadlock details in &quot;LATEST DETECTED DEADLOCK&quot; section of the show engine innodb status\G output and therefore needs an investigation of the whole sql statements executed by both transactions with the application dev team to identify the root cause and it&#39;s resolution.&lt;br /&gt;
&lt;br /&gt;
4) Unexpected errors, such as source table or even tmp table was corrupt processing of a subquery failed which was also sorting.&lt;br /&gt;
&lt;br /&gt;
In this case, we have to repair the corrupted source table using repair table table_name or mysqlcheck.&lt;br /&gt;
&lt;br /&gt;
5)  insufficient memory for sort_buffer_size allocated or Out of sort memory; increase server sort buffer size.&lt;br /&gt;
&lt;br /&gt;
Check the sort buffer size allocated on the server and increase a little at a time in amount of memory because it is a per connection variable and can cause out of memory on the server itself.&lt;br /&gt;
&lt;br /&gt;
[perl]&lt;br /&gt;
mysql&gt; show global variables like &#39;%sort%&#39;;&lt;br /&gt;
+---------------------------+--------------+&lt;br /&gt;
| Variable_name             | Value        |&lt;br /&gt;
+---------------------------+--------------+&lt;br /&gt;
| max_length_for_sort_data  | 1024         |&lt;br /&gt;
| max_sort_length           | 1024         |&lt;br /&gt;
| myisam_max_sort_file_size | 107374182400 |&lt;br /&gt;
| myisam_sort_buffer_size   | 36700160     |&lt;br /&gt;
| sort_buffer_size          | 262144       |&lt;br /&gt;
+---------------------------+--------------+&lt;br /&gt;
5 rows in set (0.14 sec)&lt;br /&gt;
[/perl]&lt;br /&gt;
&lt;br /&gt;
Apart from the above causes, Few more things needs to be checked when we see this type of messages in the error logs are :&lt;br /&gt;
&lt;br /&gt;
1) How big is your biggest single table (data + index) ?&lt;br /&gt;
2) Do you have any JOINs that involve a huge amount of data being scanned or returned ?&lt;br /&gt;
3) What file-system do you have on your machine ? &lt;br /&gt;
4) Can you identify the queries that were running at that time ? How long does it run ?&lt;br /&gt;
&lt;br /&gt;
Let&#39;s go through the above things in detail.&lt;br /&gt;
&lt;br /&gt;
To find out the biggest table size in the database, execute the below sql query &lt;br /&gt;
&lt;br /&gt;
[perl]&lt;br /&gt;
SELECT SQL_CALC_FOUND_ROWS TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, TABLE_ROWS,&lt;br /&gt;
TRUNCATE(DATA_LENGTH/pow(1024,2),2) as &#39;DATA (M)&#39;,&lt;br /&gt;
TRUNCATE(INDEX_LENGTH/pow(1024,2),2) as &#39;INDEX (M)&#39;,&lt;br /&gt;
TRUNCATE(((DATA_LENGTH+INDEX_LENGTH))/pow(1024,2),2) AS &#39;TOTAL(M)&#39;&lt;br /&gt;
FROM information_schema.tables&lt;br /&gt;
WHERE TABLE_SCHEMA  not in ( &#39;information_schema&#39;, &#39;mysql&#39;)&lt;br /&gt;
AND TABLE_TYPE = &#39;BASE TABLE&#39;&lt;br /&gt;
ORDER BY 8 DESC&lt;br /&gt;
LIMIT 1;&lt;br /&gt;
[/perl]&lt;br /&gt;
&lt;br /&gt;
The easiest way to find the query with JOINs that involve a huge amount of data being scanned or returned is to enable slow query log on the database server and run the below command on your shell prompt by replacing the actual slow query log, which gives the maximum rows scanned list in the slow query log. &lt;br /&gt;
&lt;br /&gt;
[perl]&lt;br /&gt;
$less slowquery.log | grep -i &quot;# Query_time:&quot; | awk &#39;{print $9}&#39; | sort -rn | more&lt;br /&gt;
123949125&lt;br /&gt;
123947793&lt;br /&gt;
123858573&lt;br /&gt;
123855366&lt;br /&gt;
76087924&lt;br /&gt;
75933311&lt;br /&gt;
75776390&lt;br /&gt;
75691301&lt;br /&gt;
75671196&lt;br /&gt;
75556710&lt;br /&gt;
[/perl]&lt;br /&gt;
&lt;br /&gt;
After finding out the top few large scan number details, then run the below by replacing the highest number in the grep condition to see the query details.&lt;br /&gt;
&lt;br /&gt;
[perl]&lt;br /&gt;
$less slowquery.log | grep 123949125 -A 2 B4 | more&lt;br /&gt;
[/perl]&lt;br /&gt;
&lt;br /&gt;
Once we got the list of queries which are going for large scan, we can tune it by using Explain plan, creating appropriate indexes for the columns involved in the joins and the sort order etc.&lt;br /&gt;
&lt;br /&gt;
Coming to different filesystems and it&#39;s limitations, it can be find &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_file_systems&quot;&gt;here&lt;/a&gt;&lt;br /&gt;
The filesystems and it&#39;s type on a linux machine can be found by running the below commands in the shell prompt.&lt;br /&gt;
&lt;br /&gt;
[perl]&lt;br /&gt;
[suresh@home]$ df -T&lt;br /&gt;
Filesystem    Type   1K-blocks      Used Available Use% Mounted on&lt;br /&gt;
/dev/mapper/sysvg-root&lt;br /&gt;
ext3   470000608  24019012 421721808   6% /&lt;br /&gt;
/dev/mapper/mysqlvg-mysql&lt;br /&gt;
ext3   945112464 289180564 607148540  33% /mysql&lt;br /&gt;
/dev/sda1     ext3      505604     17557    461943   4% /boot&lt;br /&gt;
tmpfs        tmpfs    24724440         0  24724440   0% /dev/shm&lt;br /&gt;
&lt;br /&gt;
[suresh@home]$ mount&lt;br /&gt;
/dev/mapper/sysvg-root on / type ext3 (rw)&lt;br /&gt;
proc on /proc type proc (rw)&lt;br /&gt;
sysfs on /sys type sysfs (rw)&lt;br /&gt;
devpts on /dev/pts type devpts (rw,gid=5,mode=620)&lt;br /&gt;
/dev/mapper/mysqlvg-mysql on /mysql type ext3 (rw)&lt;br /&gt;
/dev/sda1 on /boot type ext3 (rw)&lt;br /&gt;
tmpfs on /dev/shm type tmpfs (rw)&lt;br /&gt;
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)&lt;br /&gt;
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)&lt;br /&gt;
[/perl]&lt;br /&gt;
&lt;br /&gt;
If we have reached the file system size limits for a give table then we have go for better filesystems.&lt;br /&gt;
&lt;br /&gt;
To find the queries that are running at that time and how long is to log the processlist into a log file periodically using the below command.&lt;br /&gt;
&lt;br /&gt;
[perl]&lt;br /&gt;
mysqladmin --user=xxxx --password=xxxxx --sleep=300 processlist&lt;br /&gt;
[/perl]&lt;br /&gt;
&lt;br /&gt;
The above are the possible ways of finding the possible causes and it&#39;s resolution methods for the error &quot;Sort aborted&quot;.&lt;br /&gt;
&lt;br /&gt;
Previously, earlier to the version 5.5.10, for queries that were aborted due to sort problem, the server wrote the message Sort aborted to the error log.&lt;br /&gt;
In the latest versions, developers realize that they need to add more details to the error log when ever the error occurs, mysqld server writes more information to provide a more specific message which is useful, such as:&lt;br /&gt;
&lt;br /&gt;
[perl]&lt;br /&gt;
[ERROR] mysqld: Sort aborted: Out of memory (Needed 24 bytes)&lt;br /&gt;
&lt;br /&gt;
[ERROR] mysqld: Sort aborted: Out of sort memory,&lt;br /&gt;
consider increasing server sort buffer size&lt;br /&gt;
&lt;br /&gt;
[ERROR] mysqld: Sort aborted: Incorrect number of arguments for&lt;br /&gt;
FUNCTION test.f1; expected 0, got 1&lt;br /&gt;
In addition, if the server was started with --log-warnings=2,&lt;br /&gt;
the server write information about the host, user, and query.&lt;br /&gt;
[/perl]&lt;br /&gt;
&lt;br /&gt;
In addition, if the server was started with --log-warnings=2, the server write information about the host, user, and query.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/1147522457655091667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2011/06/investigating-sort-aborted-issues.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1147522457655091667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1147522457655091667'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2011/06/investigating-sort-aborted-issues.html' title='Investigating Sort aborted issues'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-8314597751672582170</id><published>2011-05-25T03:30:00.000-07:00</published><updated>2011-06-20T23:13:16.991-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="InnoDB error : Total number of locks exceeds the lock table size"/><title type='text'>InnoDB error : Total number of locks exceeds the lock table size</title><content type='html'>Recently, one of the clients that I&#39;m working with had a problem with one of their replication slaves where an sql statement gave an error while executing on the slave which got executed successfully on the Master server.&lt;br /&gt;
&lt;br /&gt;
The slave stopped with the error as below.&lt;br /&gt;
&lt;pre style=&quot;overflow: auto;background-color: beige&quot;&gt;&lt;span&gt;
mysql&amp;gt; show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: reporting.com
Master_User: replication
Master_Port: 3306
Connect_Retry: 10
Master_Log_File: mysql3308-bin-log.000488
Read_Master_Log_Pos: 340658086
Relay_Log_File: mysql3319-relay-log.000156
Relay_Log_Pos: 4983506
Relay_Master_Log_File: mysql3308-bin-log.000462
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1206
Last_Error: Error &#39;The total number of locks exceeds the lock table size&#39; on query. Default database: &#39;production&#39;. Query: &#39;create table Summary SELECT Dimension.calendarYearMonth, count(*) as EmailsSent, count(distinct Email_Sent.UserID) as &quot;Unique Recipients&quot;
FROM Dimension, Email_Sent
WHERE
Email_Sent.DateID = Dimension.id
AND Dimension.date &amp;gt;= &#39;2010-11-01&#39;
GROUP BY 1&#39;
Skip_Counter: 0
Exec_Master_Log_Pos: 4983353
Relay_Log_Space: 14212286599
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1206
Last_SQL_Error: Error &#39;The total number of locks exceeds the lock table size&#39; on query. Default database: &#39;production&#39;. Query: &#39;create table Summary SELECT Dimension.calendarYearMonth, count(*) as EmailsSent, count(distinct Email_Sent.UserID) as &quot;Unique Recipients&quot;
FROM Dimension, Email_Sent
WHERE
Email_Sent.DateID = Dimension.id
AND Dimension.date &amp;gt;= &#39;2010-11-01&#39;
GROUP BY 1&#39;
1 row in set (0.00 sec)
&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
I have started the slave and monitored the query running status using &quot;show engine innodb status\G&quot;.   According to the EXPLAIN plan of the query, it is estimated to scan and lock about 910 million rows. The below InnoDB status showed that it already locked 677 million rows and the slave got stopped again with the same error.&lt;br /&gt;
&lt;br /&gt;
This is an error specific to InnoDB tables. The query mentioned above attempts to set  locks on all records scanned, to ensure the data returned doesn’t change before creation of the new table.  These locks are put into an area of memory allocated within innodb_buffer_pool_size variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;br /&gt;
&lt;pre style=&quot;overflow: auto;background-color: beige&quot;&gt;&lt;span&gt;
---TRANSACTION 5722EE5D, ACTIVE 18100 sec, process no 13052, OS thread id 1222195536 fetching rows
mysql tables in use 2, locked 2
2653776 lock struct(s), heap size 327759856, 677089582 row lock(s)
MySQL thread id 2860, query id 1863366 Copying to tmp table on disk&lt;/span&gt;
create table Summary SELECT Dimension.calendarYearMonth, count(*) as EmailsSent, count(distinct Email_Sent.UserID) as &quot;Unique Recipients&quot;
FROM Dimension, Email_Sent
WHERE
Email_Sent.DateID = Dimension.id
AND Dimension.date &amp;gt;= &#39;2010-11-01&#39;
GROUP BY 1
TABLE LOCK table `production`.`Email_Sent` trx id 5722EE5D lock mode IS
RECORD LOCKS space id 5623 page no 11 n bits 440 index `ClientID` of table `production`.`Email_Sent` trx id 5722EE5D lock mode S
TABLE LOCK table `production`.`Date_Dimension` trx id 5722EE5D lock mode IS
RECORD LOCKS space id 5611 page no 34 n bits 240 index `PRIMARY` of table `production`.`Date_Dimension` trx id 5722EE5D lock mode S locks rec but not gap
RECORD LOCKS space id 5623 page no 12 n bits 440 index `ClientID` of table `production`.`Email_Sent` trx id 5722EE5D lock mode S
RECORD LOCKS space id 5623 page no 15 n bits 272 index `ClientID` of table `production`.`Email_Sent` trx id 5722EE5D lock mode S
RECORD LOCKS space id 5623 page no 18 n bits 440 index `ClientID` of table `production`.`Email_Sent` trx id 5722EE5D lock mode S
RECORD LOCKS space id 5623 page no 21 n bits 224 index `ClientID` of table `production`.`Email_Sent` trx id 5722EE5D lock mode S
RECORD LOCKS space id 5623 page no 29 n bits 440 index `ClientID` of table `production`.`Email_Sent` trx id 5722EE5D lock mode S
RECORD LOCKS space id 5623 page no 31 n bits 440 index `ClientID` of table `production`.`Email_Sent` trx id 5722EE5D lock mode S
TOO LOCKS PRINTED FOR THIS TRX: SUPPRESSING FURTHER PRINTS
&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
We found the main difference in MySQL configuration between Master and Slave was amount of memory allocated to InnoDB_buffer_pool_size because Slave was running several MySQL instances that were used for backup purposes.&lt;br /&gt;
&lt;br /&gt;
Need to increase the memory of innodb_buffer_pool_size  variable where the locks table can fit  in the configuration file and restart the database should fix the problem.&lt;br /&gt;
&lt;br /&gt;
InnoDB uses buffer pool to cache data and indexes of its tables, but it also uses it to store system information, like locks table. The query set locks on all the records it scans. If we have a small buffer pool size, then the InnoDB lock table may indeed grow so big that it does not fit in the buffer pool. Locks table size for the 677 million rows was 327M according to the innodb status.  So, we have increased the  innodb_buffer_pool_size from 500MB to 1GB which was enough to hold all the locks  and restarted the database server. Now the SQL query completed successfully on the slave.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details on the Innodb row level locks and the size it takes can be found  &lt;a href=&quot;http://www.mysqlperformanceblog.com/2006/07/13/how-much-memory-innodb-locks-really-take/&quot;&gt;here&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/8314597751672582170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2011/05/innodb-error-total-number-of-locks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/8314597751672582170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/8314597751672582170'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2011/05/innodb-error-total-number-of-locks.html' title='InnoDB error : Total number of locks exceeds the lock table size'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-7456289065178448502</id><published>2010-12-26T05:10:00.000-08:00</published><updated>2010-12-26T05:12:47.970-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Aborted connection"/><category scheme="http://www.blogger.com/atom/ns#" term="Error: ‘Access denied for user"/><category scheme="http://www.blogger.com/atom/ns#" term="Got timeout reading communication packets"/><category scheme="http://www.blogger.com/atom/ns#" term="host"/><category scheme="http://www.blogger.com/atom/ns#" term="login"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><title type='text'>Aborted connection 31084472 to db: ‘ms’ user: ‘login’ host: `x.x.x.12′ (Got timeout reading communication packets)</title><content type='html'>ERROR Message :&lt;br /&gt;081016 23:25:44 Aborted connection 31084472 to db: ‘ms’ user: ‘login’ host: `x.x.x.12′ (Got timeout reading communication packets)&lt;br /&gt;081016 23:25:44 Aborted connection 31084391 to db: ‘ms’ user: ‘login’ host: `x.x.x.13′ (Got timeout reading communication packets)&lt;br /&gt;081016 23:25:44 Aborted connection 31084488 to db: ‘ms’ user: ‘login’ host: `x.x.x.15′ (Got timeout reading communication packets)&lt;br /&gt;081016 23:25:44 Aborted connection 31084509 to db: ‘ms’ user: ‘login’ host: `x.x.x.15′ (Got timeout reading communication packets)&lt;br /&gt;081016 23:25:45 Aborted connection 31084518 to db: ‘ms’ user: ‘login’ host: `x.x.x..11′ (Got an error reading communication packets)&lt;br /&gt;The below are the Reasons to get the above error :&lt;br /&gt;Aborted connections messages appear in the error log, the cause can be any of the following:&lt;br /&gt;1) The client program did not call mysql_close() before exiting.&lt;br /&gt;2) The client had been sleeping more than wait_timeout or interactive_timeout seconds without issuing any requests to the server.&lt;br /&gt;3) The client program ended abruptly in the middle of a data transfer.&lt;br /&gt;When any of these things happen, the server increments the Aborted_clients status variable.&lt;br /&gt;The server increments the Aborted_connects status variable when the following things happen:&lt;br /&gt;1) A client doesn’t have privileges to connect to a database.&lt;br /&gt;2) A client uses an incorrect password.&lt;br /&gt;3) A connection packet doesn’t contain the right information.&lt;br /&gt;4) It takes more than connect_timeout seconds to get a connect packet.&lt;br /&gt;&lt;br /&gt;-Suresh Kuna</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/7456289065178448502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/aborted-connection-31084472-to-db-ms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/7456289065178448502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/7456289065178448502'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/aborted-connection-31084472-to-db-ms.html' title='Aborted connection 31084472 to db: ‘ms’ user: ‘login’ host: `x.x.x.12′ (Got timeout reading communication packets)'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-6082116128271614</id><published>2010-12-26T05:07:00.000-08:00</published><updated>2010-12-26T05:10:20.780-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="error reading relay log"/><category scheme="http://www.blogger.com/atom/ns#" term="Fatal error: Can’t change to run as user ‘mysql’ ; Please check that the user exists"/><category scheme="http://www.blogger.com/atom/ns#" term="sql thread"/><title type='text'>Fatal error: Can’t change to run as user ‘mysql’ ; Please check that the user exists!</title><content type='html'>Problem Statement:&lt;br /&gt;&lt;br /&gt;I got the error while starting the server, and is it not able to start as mysql user.&lt;br /&gt;It throws the below error&lt;br /&gt;&lt;br /&gt;080915 19:58:10 mysqld started&lt;br /&gt;Fatal error: Can’t change to run as user ‘mysql’ ; Please check that the user exists!&lt;br /&gt;080915 19:58:10 Aborting&lt;br /&gt;&lt;br /&gt;080915 19:58:10 /usr/local/mysql4.1.3/bin/mysqld: Shutdown complete&lt;br /&gt;&lt;br /&gt;080915 19:58:10 mysqld ended&lt;br /&gt;&lt;br /&gt;080915 20:03:59 mysqld started&lt;br /&gt;Fatal error: Can’t change to run as user ‘mysql’ ; Please check that the user exists!&lt;br /&gt;080915 20:03:59 Aborting&lt;br /&gt;&lt;br /&gt;080915 20:03:59 /usr/local/mysql4.1.3/bin/mysqld: Shutdown complete&lt;br /&gt;&lt;br /&gt;080915 20:03:59 mysqld ended&lt;br /&gt;&lt;br /&gt;080915 20:09:07 mysqld started&lt;br /&gt;Fatal error: Can’t change to run as user ‘mysql’ ; Please check that the user exists!&lt;br /&gt;080915 20:09:07 Aborting&lt;br /&gt;&lt;br /&gt;080915 20:09:07 /usr/local/mysql4.1.3/bin/mysqld: Shutdown complete&lt;br /&gt;&lt;br /&gt;080915 20:09:07 mysqld ended&lt;br /&gt;&lt;br /&gt;080915 20:12:21 mysqld started&lt;br /&gt;080915 20:12:21 InnoDB: Started; log sequence number 0 43644&lt;br /&gt;/usr/local/mysql/bin/mysqld: ready for connections.&lt;br /&gt;Version: ‘4.1.3-beta-standard’ socket: ‘/tmp/mysql3311.sock’ port: 3311&lt;br /&gt;080915 20:12:21 Slave SQL thread initialized, starting replication in log ‘hawk-bin.000027′ at position 301237442, relay log&lt;br /&gt;‘./menus-relay-bin.000006′ position: 4&lt;br /&gt;080915 20:12:21 Slave I/O thread: connected to master ‘replicate@x.x.x.90:3306′, replication started in log ‘hawk-bin.&lt;br /&gt;000027′ at position 301237442&lt;br /&gt;080915 20:12:21 Error reading packet from server: Client requested master to start replication from impossible position (ser&lt;br /&gt;ver_errno=1236)&lt;br /&gt;080915 20:12:21 Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master wh&lt;br /&gt;en reading data from binary log&lt;br /&gt;080915 20:12:21 Slave I/O thread exiting, read up to log ‘hawk-bin.000027′, position 301237442&lt;br /&gt;080915 20:13:07 Aborted connection 4 to db: ‘unconnected’ user: ‘root’ host: `localhost’ (Got an error writing communication&lt;br /&gt;packets)&lt;br /&gt;080915 20:13:07 /usr/local/mysql/bin/mysqld: Normal shutdown&lt;br /&gt;&lt;br /&gt;080915 20:13:07 Error reading relay log event: slave SQL thread was killed&lt;br /&gt;080915 20:13:07 InnoDB: Starting shutdown…&lt;br /&gt;080915 20:13:09 InnoDB: Shutdown completed; log sequence number 0 43644&lt;br /&gt;080915 20:13:09 /usr/local/mysql/bin/mysqld: Shutdown complete&lt;br /&gt;&lt;br /&gt;080915 20:13:09 mysqld ended&lt;br /&gt;&lt;br /&gt;080915 20:23:30 mysqld started&lt;br /&gt;080915 20:23:31 InnoDB: Started; log sequence number 0 43644&lt;br /&gt;/usr/local/mysql/bin/mysqld: ready for connections.&lt;br /&gt;Version: ‘4.1.3-beta-standard’ socket: ‘/tmp/mysql3311.sock’ port: 3311&lt;br /&gt;080915 20:23:31 Slave SQL thread initialized, starting replication in log ‘hawk-bin.000027′ at position 301237442, relay log&lt;br /&gt;‘./menus-relay-bin.000008′ position: 4&lt;br /&gt;080915 20:23:31 Slave I/O thread: connected to master ‘replicate@x.x.x.90:3306′, replication started in log ‘hawk-bin.&lt;br /&gt;000027′ at position 301237442&lt;br /&gt;080915 20:23:31 Error reading packet from server: Client requested master to start replication from impossible position (ser&lt;br /&gt;ver_errno=1236)&lt;br /&gt;080915 20:23:31 Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master wh&lt;br /&gt;en reading data from binary log&lt;br /&gt;080915 20:23:31 Slave I/O thread exiting, read up to log ‘hawk-bin.000027′, position 301237442&lt;br /&gt;080915 20:34:49 Aborted connection 3 to db: ‘unconnected’ user: ‘root’ host: `localhost’ (Got an error reading communication&lt;br /&gt;packets)&lt;br /&gt;080915 20:35:56 Error reading relay log event: slave SQL thread was killed&lt;br /&gt;080915 20:35:59 Slave SQL thread initialized, starting replication in log ‘hawk-bin.000027′ at position 301237442, relay log&lt;br /&gt;‘./menus-relay-bin.000009′ position: 4&lt;br /&gt;&lt;br /&gt;Solution :&lt;br /&gt;The issue was solve by running the server with “sudo - mysql” before the mysql start up script.&lt;br /&gt;&lt;br /&gt;sudo -u mysql $BASEDIR/bin/mysqld –defaults-file=$DEFAULT –basedir=$BASEDIR –datadir=$DATADIR \&lt;br /&gt;–user=mysql –pid-file=$PIDFILE 2&gt;&amp;1</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/6082116128271614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/fatal-error-cant-change-to-run-as-user.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/6082116128271614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/6082116128271614'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/fatal-error-cant-change-to-run-as-user.html' title='Fatal error: Can’t change to run as user ‘mysql’ ; Please check that the user exists!'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-7150655763509386104</id><published>2010-12-26T05:04:00.000-08:00</published><updated>2010-12-26T05:06:28.332-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Could not parse relay log event entry."/><title type='text'>Could not parse relay log event entry.</title><content type='html'>If a slave show the below error then&lt;br /&gt;&lt;br /&gt;1) If the slaves relay-log is corrupted, the run the change master to get the slave in sync with master.&lt;br /&gt;&lt;br /&gt;2) we have to import a fresh dump from master to get the slave in sync with master if the master’s binlog is corrupted.&lt;br /&gt;&lt;br /&gt;Show slave status :&lt;br /&gt;&lt;br /&gt;mysql&gt; show slave status\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Master_Host: 10.x.x.39&lt;br /&gt;Master_User: replicate&lt;br /&gt;Master_Port: 3307&lt;br /&gt;Connect_retry: 60&lt;br /&gt;Master_Log_File: db-master.077&lt;br /&gt;Read_Master_Log_Pos: 7400184&lt;br /&gt;Relay_Log_File: db-slave-relay-bin.010&lt;br /&gt;Relay_Log_Pos: 150588765&lt;br /&gt;Relay_Master_Log_File: db-master.076&lt;br /&gt;Slave_IO_Running: Yes&lt;br /&gt;Slave_SQL_Running: No&lt;br /&gt;Replicate_do_db: broadbandnew,archive&lt;br /&gt;Replicate_ignore_db:&lt;br /&gt;Last_errno: 0&lt;br /&gt;Last_error: Could not parse relay log event entry. The possible reasons are: the master’s binary log is corrupted (you can check this by running ‘mysqlbinlog’ on the binary log), the slave’s relay log is corrupted (you can check this by running ‘mysqlbinlog’ on the relay log), a network problem, or a bug in the master’s or slave’s MySQL code. If you want to check the master’s binary log or slave’s relay log, you will be able to know their names by issuing ‘SHOW SLAVE STATUS’ on this slave.&lt;br /&gt;Skip_counter: 0&lt;br /&gt;Exec_master_log_pos: 150588671&lt;br /&gt;Relay_log_space: 157989718&lt;br /&gt;1 row in set (0.00 sec)</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/7150655763509386104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/could-not-parse-relay-log-event-entry.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/7150655763509386104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/7150655763509386104'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/could-not-parse-relay-log-event-entry.html' title='Could not parse relay log event entry.'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-8904158497120817972</id><published>2010-12-26T04:55:00.000-08:00</published><updated>2010-12-26T04:56:43.228-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Duplicate entry for key 1′ on query"/><title type='text'>Duplicate entry for key 1′ on query</title><content type='html'>If the slave show the following error then skip the same as below.&lt;br /&gt;&lt;br /&gt;mysql&gt; show slave status\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Master_Host: x.x.4.3&lt;br /&gt;Master_User: replicate&lt;br /&gt;Master_Port: 3307&lt;br /&gt;Connect_retry: 60&lt;br /&gt;Master_Log_File: master.077&lt;br /&gt;Read_Master_Log_Pos: 7394212&lt;br /&gt;Relay_Log_File: slave- relay-bin.010&lt;br /&gt;Relay_Log_Pos: 150588010&lt;br /&gt;Relay_Master_Log_File: master.076&lt;br /&gt;Slave_IO_Running: Yes&lt;br /&gt;Slave_SQL_Running: No&lt;br /&gt;Replicate_do_db: bandnew,archive&lt;br /&gt;Replicate_ignore_db:&lt;br /&gt;Last_errno: 1062&lt;br /&gt;Last_error: Error ‘Duplicate entry ‘122453106710.31.87.80-mdazaz123-2008-10-21 03:38:23′ for key 1′ on query. Default database: ‘bandnew’. Query:&lt;br /&gt;&lt;br /&gt;‘insert into br_info(UI_ID,UI_USER,CD_CAF,BI_PRODUCT,BI_STIME,BI_ETIME,BI_TIMEUTILIZED,BI_OPENINGBAL,BI_CLBAL,&lt;br /&gt;&lt;br /&gt;BI_BILLEDAMT,BI_USERIP,BI_SERVICENAME,BI_BYTESIN,BI_BYTESOUT,BI_BYTES,BI_REMARKS,BI_PUBLICIP,BI_SAMIP) values&lt;br /&gt;&lt;br /&gt;(’122453106710.31.87.80′,’mdz123′,’Default’,&#39;D4NL’,&#39;2008-10-21 03:38:23′,&lt;br /&gt;&lt;br /&gt;‘2008-10-21 06:10:24′,152,197.09,195.08,’2.01′,’10.31.87.80′,’F&#39;,295137740,125414454,420552194,’D&#39;,’118.9.4.47′,’210.1.80.3′)’&lt;br /&gt;Skip_counter: 0&lt;br /&gt;Exec_master_log_pos: 150587868&lt;br /&gt;Relay_log_space: 157983746&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&gt; set global sql_slave_skip_counter=1;start slave;show slave status\G&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Master_Host: x.x.4.3&lt;br /&gt;Master_User: replicate&lt;br /&gt;Master_Port: 3307&lt;br /&gt;Connect_retry: 60&lt;br /&gt;Master_Log_File: master.077&lt;br /&gt;Read_Master_Log_Pos: 7394212&lt;br /&gt;Relay_Log_File: slave- relay-bin.010&lt;br /&gt;Relay_Log_Pos: 150588010&lt;br /&gt;Relay_Master_Log_File: master.076&lt;br /&gt;Slave_IO_Running: Yes&lt;br /&gt;Slave_SQL_Running: Yes&lt;br /&gt;Replicate_do_db: bandnew,archive&lt;br /&gt;Replicate_ignore_db:&lt;br /&gt;Last_errno: 0&lt;br /&gt;Last_error:&lt;br /&gt;Skip_counter: 1&lt;br /&gt;Exec_master_log_pos: 150587868&lt;br /&gt;Relay_log_space: 157983746&lt;br /&gt;1 row in set (0.00 sec)</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/8904158497120817972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/duplicate-entry-for-key-1-on-query.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/8904158497120817972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/8904158497120817972'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/duplicate-entry-for-key-1-on-query.html' title='Duplicate entry for key 1′ on query'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-3317392498961791737</id><published>2010-12-26T04:53:00.000-08:00</published><updated>2010-12-26T04:54:43.890-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Error: log file /mysql/data/mysqld/ib_logfile0 is of different size"/><category scheme="http://www.blogger.com/atom/ns#" term="ib_logfile0"/><category scheme="http://www.blogger.com/atom/ns#" term="innodb_log_file_size"/><title type='text'>Error: log file /mysql/data/mysqld/ib_logfile0 is of different size</title><content type='html'>ProblemStatement:&lt;br /&gt;&lt;br /&gt; I have got the below error while starting the mysql after configuring a new slave with the tall ball of the master data directory.&lt;br /&gt;&lt;br /&gt;081022 6:24:41 InnoDB: Warning: shutting down a not properly started&lt;br /&gt;InnoDB: or created database!&lt;br /&gt;081022 6:24:41 /usr/local/mysql4020/libexec/mysqld: Shutdown Complete&lt;br /&gt;&lt;br /&gt;InnoDB: Error: log file /mysql/data/mysqld/ib_logfile0 is of different size 0 209715200 bytes&lt;br /&gt;InnoDB: than specified in the .cnf file 0 104857600 bytes!&lt;br /&gt;081022 6:24:42 Can’t init databases&lt;br /&gt;081022 6:24:42 Aborting&lt;br /&gt;&lt;br /&gt;Solution :&lt;br /&gt;&lt;br /&gt;The same has been resolved by changing the below variable in the cnf file as same in the master config file &lt;br /&gt;&lt;br /&gt;innodb_log_file_size = 200M</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/3317392498961791737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/error-log-file-mysqldatamysqldiblogfile.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3317392498961791737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3317392498961791737'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/error-log-file-mysqldatamysqldiblogfile.html' title='Error: log file /mysql/data/mysqld/ib_logfile0 is of different size'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-4720595426490434629</id><published>2010-12-26T04:50:00.000-08:00</published><updated>2010-12-26T04:52:37.155-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DBConvert for Oracle and MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Error: ‘Access denied for user"/><category scheme="http://www.blogger.com/atom/ns#" term="password"/><title type='text'>Error: ‘Access denied for user ‘replicate’@&#39;10.0.0.8′ (using password: YES)’</title><content type='html'>Problem Statement:&lt;br /&gt;&lt;br /&gt;we got the below error message while setting the replication.&lt;br /&gt;&lt;br /&gt;Error: ‘Access denied for user ‘replicate’@&#39;10.0.0.8′ (using password: YES)’.&lt;br /&gt;&lt;br /&gt;Solution :&lt;br /&gt;&lt;br /&gt;&lt;18:09:58&gt;root@6.83: ~#mysql -u root -p -h10.0.0.55 -P3306&lt;br /&gt;&lt;br /&gt;If the error is password error then edit the password error.&lt;br /&gt;Error: ‘Access denied for user ‘replicate’@&#39;10.0.0.8′ (using password: YES)’&lt;br /&gt;&lt;br /&gt;&lt;18:09:58&gt;root@6.83: ~#vi /etc/my.cnf (To change password, edit the cnf file)&lt;br /&gt;&lt;18:09:58&gt;root@6.83: ~#less /data/mysqldata/err.log&lt;br /&gt;&lt;br /&gt;mysql&gt; change master to master_password=’xxxxx’;&lt;br /&gt;&lt;br /&gt;mysql&gt; change master to master_password=’replicate’,master_user=’replicate’,master_host=’10.0.0.55′,master_port=3306,master_log_file=’narnia-bin.000030′,master_log_pos=271266680;&lt;br /&gt;&lt;br /&gt;mysql&gt; stop slave;&lt;br /&gt;mysql&gt; start slave;&lt;br /&gt;&lt;br /&gt;mysql&gt; show slave status\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Slave_IO_State: Connecting to master&lt;br /&gt;Master_Host: 10.0.0.55&lt;br /&gt;Master_User: replicate&lt;br /&gt;Master_Port: 3306&lt;br /&gt;Connect_Retry: 60&lt;br /&gt;Master_Log_File: arnia-bin.000030&lt;br /&gt;Read_Master_Log_Pos: 271260976&lt;br /&gt;Relay_Log_File: relay-bin.000004&lt;br /&gt;Relay_Log_Pos: 4&lt;br /&gt;Relay_Master_Log_File: arnia-bin.000030&lt;br /&gt;Slave_IO_Running: Yes&lt;br /&gt;Slave_SQL_Running: Yes&lt;br /&gt;Replicate_Do_DB:&lt;br /&gt;Replicate_Ignore_DB:&lt;br /&gt;Replicate_Do_Table: mail.appearance_new,pop.hostcnt&lt;br /&gt;Replicate_Ignore_Table:&lt;br /&gt;Replicate_Wild_Do_Table:&lt;br /&gt;Replicate_Wild_Ignore_Table:&lt;br /&gt;Last_Errno: 0&lt;br /&gt;Last_Error:&lt;br /&gt;Skip_Counter: 0&lt;br /&gt;Exec_Master_Log_Pos: 271266680&lt;br /&gt;Relay_Log_Space: 4&lt;br /&gt;Until_Condition: None&lt;br /&gt;Until_Log_File:&lt;br /&gt;Until_Log_Pos: 0&lt;br /&gt;Master_SSL_Allowed: No&lt;br /&gt;Master_SSL_CA_File:&lt;br /&gt;Master_SSL_CA_Path:&lt;br /&gt;Master_SSL_Cert:&lt;br /&gt;Master_SSL_Cipher:&lt;br /&gt;Master_SSL_Key:&lt;br /&gt;Seconds_Behind_Master: NULL&lt;br /&gt;1 row in set (0.00 sec)</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/4720595426490434629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/error-access-denied-for-user.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/4720595426490434629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/4720595426490434629'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/error-access-denied-for-user.html' title='Error: ‘Access denied for user ‘replicate’@&#39;10.0.0.8′ (using password: YES)’'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-1245747924882507338</id><published>2010-12-26T04:49:00.000-08:00</published><updated>2010-12-26T04:50:10.794-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master when reading data from binary log"/><title type='text'>Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master when reading data from binary log</title><content type='html'>Problem statement:&lt;br /&gt;&lt;br /&gt;The below is problem I faced in a well running replication system.&lt;br /&gt;&lt;br /&gt;Error Message :&lt;br /&gt;081016 18:34:43  Error reading packet from server: Client requested master to start replication from impossible position (ser&lt;br /&gt;ver_errno=1236)&lt;br /&gt;081016 18:34:43  Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master when reading data from binary log&lt;br /&gt;081016 18:34:43  Slave I/O thread exiting, read up to log ‘lot-bin.000065′, position 13664242&lt;br /&gt;081016 18:35:04  Error reading relay log event: slave SQL thread was killed&lt;br /&gt;081016 18:45:40  Slave SQL thread initialized, starting replication in log ‘lot-bin.000065′ at position 13664242, relay log’./mx5-relay-bin.000001′ position: 13664284&lt;br /&gt;081016 18:45:40  Slave I/O thread: connected to master ‘replicate@10.0.4:3306′,  replication started in log ‘lot-bin.&lt;br /&gt;000065′ at position 13664242&lt;br /&gt;&lt;br /&gt;Solution :&lt;br /&gt;1)  If the value of Read_Master_Log_Pos has a normal value, and slave asked weird position, this could be some internal bug. Now I see only a single way, but it could be difficult: if you have –log-slave-updates, use slave binary logs to find the last executed statement and it’s position in master logs, and CHANGE MASTER to that position.&lt;br /&gt;2) Go onto the master execute&lt;br /&gt;SHOW MASTER STATUS&lt;br /&gt;Look at the output and find the log that the slave is pointing to. Look at the File size field.&lt;br /&gt;Next look at the slave output from the slave reporting the issue. Look at Exec_Master_Log_Pos, is that value greater then the File Size on the master if so issue&lt;br /&gt;CHANGE MASTER TO MASTER_LOG_FILE=[NEXT FILE], MASTER_LOG_POS=4;&lt;br /&gt;slave start;</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/1245747924882507338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/got-fatal-error-1236-client-requested.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1245747924882507338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1245747924882507338'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/got-fatal-error-1236-client-requested.html' title='Got fatal error 1236: ‘Client requested master to start replication from impossible position’ from master when reading data from binary log'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-3037757315602079348</id><published>2010-12-26T04:47:00.000-08:00</published><updated>2010-12-26T04:48:50.747-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ERROR 1251: Client does not support authentication protocol"/><category scheme="http://www.blogger.com/atom/ns#" term="flush privileges"/><category scheme="http://www.blogger.com/atom/ns#" term="Mysql client"/><category scheme="http://www.blogger.com/atom/ns#" term="old_password"/><category scheme="http://www.blogger.com/atom/ns#" term="upgrading"/><title type='text'>ERROR 1251: Client does not support authentication protocol</title><content type='html'>Problem Statement:&lt;br /&gt;&lt;br /&gt;I got the below error while trying to accessing the upgraded mysqld server with a old client.&lt;br /&gt;&lt;br /&gt;Error :&lt;br /&gt;&lt;br /&gt;ERROR 1251: Client does not support authentication protocol&lt;br /&gt;requested by server; consider upgrading MySQL client&lt;br /&gt;&lt;br /&gt;Solution :&lt;br /&gt;&lt;br /&gt;I have resolved the above my updating the password as below.&lt;br /&gt;&lt;br /&gt;update user set password=old_password(’new_password’) where user=’user_name’ and host=’10.0.0.2′;&lt;br /&gt;&lt;br /&gt;flush privileges;&lt;br /&gt;&lt;br /&gt;and then try to access the mysqld server and now you will be able to connect to the server succesfully.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/3037757315602079348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/error-1251-client-does-not-support.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3037757315602079348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3037757315602079348'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/error-1251-client-does-not-support.html' title='ERROR 1251: Client does not support authentication protocol'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-5168549723596520608</id><published>2010-12-26T04:43:00.000-08:00</published><updated>2010-12-26T04:46:08.278-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Can’t get CREATE TABLE"/><category scheme="http://www.blogger.com/atom/ns#" term="Can’t open file"/><category scheme="http://www.blogger.com/atom/ns#" term="errno: 145"/><title type='text'>Can’t get CREATE TABLE (Can’t open file: ‘Tory_Map.MYI’. (errno: 145))</title><content type='html'>Error Message :&lt;br /&gt;/usr/local/mysql/bin/mysqldump: Can’t get CREATE TABLE for table `Tory_Map` (Can’t open file: ‘Tory_Map.MYI’. (errno: 145))&lt;br /&gt;&lt;br /&gt;Solution :&lt;br /&gt;1) Do a show table status as below:&lt;br /&gt;mysql&gt; show table status like ‘Tory_Map’\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Name: Tory_Map&lt;br /&gt;Type: NULL&lt;br /&gt;Row_format: NULL&lt;br /&gt;Rows: NULL&lt;br /&gt;Avg_row_length: NULL&lt;br /&gt;Data_length: NULL&lt;br /&gt;Max_data_length: NULL&lt;br /&gt;Index_length: NULL&lt;br /&gt;Data_free: NULL&lt;br /&gt;Auto_increment: NULL&lt;br /&gt;Create_time: NULL&lt;br /&gt;Update_time: NULL&lt;br /&gt;Check_time: NULL&lt;br /&gt;Create_options: NULL&lt;br /&gt;Comment: Can’t open file: ‘Tory_Map.MYI’. (errno: 145)&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;2) and then do a check table as below.&lt;br /&gt;mysql&gt; check table Tory_Map;&lt;br /&gt;+——————+——-+———-+——————————-+&lt;br /&gt;| Table            | Op    | Msg_type | Msg_text                      |&lt;br /&gt;+——————+——-+———-+——————————-+&lt;br /&gt;| doc.Tory_Map | check | warning  | Table is marked as crashed    |&lt;br /&gt;| doc.Tory_Map | check | error    | Found 3670180 keys of 3670179 |&lt;br /&gt;| doc.Tory_Map | check | error    | Corrupt                       |&lt;br /&gt;+——————+——-+———-+——————————-+&lt;br /&gt;3 rows in set (20 min 1.65 sec)&lt;br /&gt;&lt;br /&gt;3) If the table is marked as crashed then do a repair of that table as below.&lt;br /&gt;mysql&gt; repair table Tory_Map;&lt;br /&gt;&lt;br /&gt;+——————+——–+———-+———-+&lt;br /&gt;| Table            | Op     | Msg_type | Msg_text |&lt;br /&gt;+——————+——–+———-+———-+&lt;br /&gt;| doc.Tory_Map | repair | status   | OK       |&lt;br /&gt;+——————+——–+———-+———-+&lt;br /&gt;1 row in set (1 min 42.77 sec)&lt;br /&gt;&lt;br /&gt;and if you do a check table now, the result has to be ok as below.&lt;br /&gt;mysql&gt; check table Tory_Map;&lt;br /&gt;+——————+——-+———-+———-+&lt;br /&gt;| Table            | Op    | Msg_type | Msg_text |&lt;br /&gt;+——————+——-+———-+———-+&lt;br /&gt;| doc.Tory_Map | check | status   | OK       |&lt;br /&gt;+——————+——-+———-+———-+&lt;br /&gt;1 row in set (6 min 3.33 sec)</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/5168549723596520608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/cant-get-create-table-cant-open-file.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/5168549723596520608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/5168549723596520608'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/cant-get-create-table-cant-open-file.html' title='Can’t get CREATE TABLE (Can’t open file: ‘Tory_Map.MYI’. (errno: 145))'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-5805747858661921769</id><published>2010-12-26T04:42:00.001-08:00</published><updated>2010-12-26T04:43:54.058-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apparent master shutdown"/><category scheme="http://www.blogger.com/atom/ns#" term="Failed reading log event"/><category scheme="http://www.blogger.com/atom/ns#" term="Replication resumed"/><title type='text'>Replication resumed, Apparent master shutdown, Failed reading log event</title><content type='html'>The slave server is getting this error in error log.&lt;br /&gt;&lt;br /&gt;081102  0:30:18 [Note] Slave: connected to master ‘replicate@10.0.1.5:3310′,replication resumed in log ‘central3310.000142′ at position 789529654&lt;br /&gt;081102  0:30:18 [Note] Slave: received end packet from server, apparent master shutdown:&lt;br /&gt;081102  0:30:18 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log ‘central3310.000142′ position 789529654&lt;br /&gt;&lt;br /&gt;Solution :&lt;br /&gt;&lt;br /&gt;The problem has started when a new slave has been configured for the existing setup. The slave server-id is matching exactly with another slave server-id, so the replication is happening for some time and then stopping. Finally one server is getting crashed. Then stop one of the slaves, change the server-id and start the slave to rectify the same.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/5805747858661921769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/replication-resumed-apparent-master.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/5805747858661921769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/5805747858661921769'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/replication-resumed-apparent-master.html' title='Replication resumed, Apparent master shutdown, Failed reading log event'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-3472607021347840630</id><published>2010-12-26T04:40:00.000-08:00</published><updated>2010-12-26T04:41:26.073-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ibdata"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><title type='text'>Error: data file /mysql/data/mysqld/ibdata1 is of a different size</title><content type='html'>If the Mysql is not starting and the error log consists of the below error after the configuration of a slave with the tar file of master.&lt;br /&gt;&lt;br /&gt;081022 6:19:02 InnoDB: Warning: shutting down a not properly started&lt;br /&gt;InnoDB: or created database!&lt;br /&gt;081022 6:19:02 /usr/local/mysql4020/libexec/mysqld: Shutdown Complete&lt;br /&gt;&lt;br /&gt;InnoDB: Error: data file /mysql/data/mysqld/ibdata1 is of a different size&lt;br /&gt;InnoDB: 128000 pages (rounded down to MB)&lt;br /&gt;InnoDB: than specified in the .cnf file 65536 pages!&lt;br /&gt;InnoDB: Could not open or create data files.&lt;br /&gt;InnoDB: If you tried to add new data files, and it failed here,&lt;br /&gt;InnoDB: you should now edit innodb_data_file_path in my.cnf back&lt;br /&gt;InnoDB: to what it was, and remove the new ibdata files InnoDB created&lt;br /&gt;InnoDB: in this failed attempt. InnoDB only wrote those files full of&lt;br /&gt;InnoDB: zeros, but did not yet use them in any way. But be careful: do not&lt;br /&gt;InnoDB: remove old data files which contain your precious data!&lt;br /&gt;081022 6:19:04 Can’t init databases&lt;br /&gt;081022 6:19:04 Aborting&lt;br /&gt;&lt;br /&gt;Then change the below variable as the same in the master cnf file&lt;br /&gt;&lt;br /&gt;innodb_data_file_path =ibdata1:2000M;ibdata2:100M:autoextend&lt;br /&gt;and start the mysqld server.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/3472607021347840630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/error-data-file-mysqldatamysqldibdata1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3472607021347840630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3472607021347840630'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/error-data-file-mysqldatamysqldibdata1.html' title='Error: data file /mysql/data/mysqld/ibdata1 is of a different size'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-2695243826366376287</id><published>2010-12-26T04:36:00.000-08:00</published><updated>2010-12-26T04:38:48.491-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="connect_timeout"/><category scheme="http://www.blogger.com/atom/ns#" term="lost connection to server"/><category scheme="http://www.blogger.com/atom/ns#" term="max_allowed_packet"/><category scheme="http://www.blogger.com/atom/ns#" term="net_read_timeout"/><title type='text'>Lost connection to MySQL server</title><content type='html'>This type of error may occur in the below scenarios.&lt;br /&gt;&lt;br /&gt;1) It indicates network connectivity trouble. If the error message includes “during query” then we have to look at the query and the number of rows being sent.&lt;br /&gt;Then try increasing “net_read_timeout” variable from its default value.&lt;br /&gt;2) It can happen when the client is attempting the initial connection to the server. If your “connect_timeout” value is set to only a few seconds, you can increase the same for resolving this issue.&lt;br /&gt;3) It can occur when using BLOB values that are larger than “max_allowed_packet” and may get “packet too large” as error, then increase the “max_allowed_packet” value to resolve the same.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/2695243826366376287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/lost-connection-to-mysql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/2695243826366376287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/2695243826366376287'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/lost-connection-to-mysql-server.html' title='Lost connection to MySQL server'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-8360668664114461077</id><published>2010-12-26T04:35:00.000-08:00</published><updated>2010-12-26T04:36:46.228-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="lost connection to server"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql_upgrade"/><category scheme="http://www.blogger.com/atom/ns#" term="mysqldump"/><category scheme="http://www.blogger.com/atom/ns#" term="procedure status"/><title type='text'>show procedure status or mysqldump with routines causing mysqld restart in 5.1.40 version</title><content type='html'>When we take a mysqldump with routines or show procedure status where Db=’dbname’;&lt;br /&gt;&lt;br /&gt;The mysqld server got an error like “Lost connection to mysqld server”, when we login into server the will be running and it got restarted.&lt;br /&gt;&lt;br /&gt;To fix this, upgrade the db by using mysql_upgrade and it got fixed for me.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/8360668664114461077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/show-procedure-status-or-mysqldump-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/8360668664114461077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/8360668664114461077'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/show-procedure-status-or-mysqldump-with.html' title='show procedure status or mysqldump with routines causing mysqld restart in 5.1.40 version'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-1373725792216998079</id><published>2010-12-26T04:31:00.000-08:00</published><updated>2010-12-26T04:34:00.886-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="full table scan"/><category scheme="http://www.blogger.com/atom/ns#" term="index"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql cluster"/><category scheme="http://www.blogger.com/atom/ns#" term="primary key"/><category scheme="http://www.blogger.com/atom/ns#" term="query execution"/><category scheme="http://www.blogger.com/atom/ns#" term="replication"/><category scheme="http://www.blogger.com/atom/ns#" term="unique key"/><title type='text'>MySQL Cluster Query Execution</title><content type='html'>MySQL Cluster executes the queries depending on the below type of scan’s it does&lt;br /&gt;&lt;br /&gt;   1. Primary key lookup&lt;br /&gt;   2. Unique key lookup&lt;br /&gt;   3. Ordered index scan (i.e., non-unique indexes that use T-trees)&lt;br /&gt;   4. Full table scan&lt;br /&gt;&lt;br /&gt;Let’s say you have 4 data nodes in your cluster (NoOfReplicas=2). This means you have 2 node groups and each one has half the data. Cluster uses a hash on the primary key (unless you’ve controlled the partitioning using the 5.1 partitioning features). So for any table, half the rows are in one node group and half the rows are the in other node group.&lt;br /&gt;&lt;br /&gt;Now for the 4 types of query execution. You can verify which type of execution is used with EXPLAIN. Here’s how each ones works:&lt;br /&gt;&lt;br /&gt;   1. Primary key lookup - the MySQL server can calculate the hash on the primary key and know which data node the relevant row resides in. Then the MySQL server contacts that data node and receives the row.&lt;br /&gt;   2. Unique key lookup - the MySQL server cannot know which data node the row might be stored in. So it contacts a pseudo-random node. That data node has a hidden table that maps the unique key values to the primary key. Then the hash on the primary key reveals where the row resides.&lt;br /&gt;   3. Ordered index scans are sent in parallel to all data nodes, where they search their local t-tree.&lt;br /&gt;   4. Full table scans are send in parallel to all data nodes, where they scan their primary fragment.&lt;br /&gt;&lt;br /&gt;Summary: primary key lookups are best. If you have more than 2 nodes, throughput goes up because all nodes are actively serving different fragments of data. Ordered index lookup and full table scans are done in parallel, so more nodes leads to better performance.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/1373725792216998079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/mysql-cluster-query-execution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1373725792216998079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/1373725792216998079'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/12/mysql-cluster-query-execution.html' title='MySQL Cluster Query Execution'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-5955428798524733224</id><published>2010-01-03T21:26:00.000-08:00</published><updated>2010-01-03T21:44:14.184-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="monitoring"/><category scheme="http://www.blogger.com/atom/ns#" term="monyog"/><category scheme="http://www.blogger.com/atom/ns#" term="MONyog MySQL Monitor and Advisor"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql monitoring tools"/><title type='text'>MONyog MySQL Monitor and Advisor</title><content type='html'>MONyog MySQL Monitor and Advisor helps to manage more MySQL servers, tune current MySQL servers and fix problems with their MySQL database applications before becoming serious problems.MONyog pro-actively monitors enterprise database environments and provides expert advice on how even those new to MySQL can tighten security, optimize performance and reduce downtime of their MySQL powered systems.&lt;br /&gt;As a MONyog user you will know in advance if server resources will soon be running short. You can plan a hardware replacement or upgrade in comfortable time and not when it is almost too late (or just plain too late!). And the metrics about the server that MONyog gives you will help to decide what to upgrade: Faster CPU, More RAM, Faster disc systems - or maybe only remove another program from the computer where the MySQL server is running.&lt;br /&gt;&lt;br /&gt;MONyog provides a log analysis module, a &quot;query sniffer&quot; and a &quot;processlist watcher&quot; that makes it easy to identify the statements and applications that run slow on the server. This includes various filtering and EXPLAIN options for an efficient workflow when you want to optimize your applications. To use the MONyog mail alert functionality to mail you alerts about a MySQL server you will first need to select that feature when registering a server. You can choose to receive mails, not only when there are problems but also to notify that the system is running smoothly at regular intervals. Further, you can set the minimum time interval between mails sent by MONyog to suit your needs and to avoid cluttering your mailbox. For every MySQL server choose a setting depending on how important the performance of this particular server is.&lt;br /&gt;&lt;br /&gt;MONyog MySQL Monitor and Advisor Features&lt;br /&gt;Agent-less architecture&lt;br /&gt;Get up and running in less than 1 minute!&lt;br /&gt;No installation required on servers&lt;br /&gt;Install on a single machine and monitor any no. of servers&lt;br /&gt;No hassles of upgrading agents on all server&lt;br /&gt;Server Optimization&lt;br /&gt;Completely new set of Advisors&lt;br /&gt;Monitoring Tools for MySQL Community and Enterprise Servers&lt;br /&gt;History/Trend Analysis&lt;br /&gt;Quick Performance Tuning and Optimization&lt;br /&gt;Analyze MySQL and OS performance data collected over a period of time&lt;br /&gt;Error Log Monitoring New!&lt;br /&gt;Find Problem SQL&lt;br /&gt;Querying MySQL Proxy&lt;br /&gt;Analyzing General Query Log&lt;br /&gt;Analyzing Slow Query Log&lt;br /&gt;Issuing SHOW PROCESSLIST at regular intervals&lt;br /&gt;Additionally all the above reports can be exported as CSV New!&lt;br /&gt;Multi-platform Support&lt;br /&gt;Monitor MySQL on any platform&lt;br /&gt;Available on Windows and Linux&lt;br /&gt;Support for both 64-bit and 32-bit Linux&lt;br /&gt;Both RPM and Non RPM Package&lt;br /&gt;Security&lt;br /&gt;Detect MySQL hacking attempts&lt;br /&gt;Identify and fix security vulnerabilities&lt;br /&gt;User Friendly GUI&lt;br /&gt;AJAX interface&lt;br /&gt;Simple Descriptions for all performance metrics. Helps you learn MySQL Internals&lt;br /&gt;Fully customizable using java script and MONyog Object Model&lt;br /&gt;Compare unlimited MySQL servers side-by-side on Real time Dashboard&lt;br /&gt;Enterprise dashboard helps identify problems quickly&lt;br /&gt;Monitor Replication&lt;br /&gt;Get alerts when replication lags behind or if slave has stopped&lt;br /&gt;Replication Log details for replication trouble shooting&lt;br /&gt;Miscellaneous Features&lt;br /&gt;Shows Processlist displaying information on running queries as per execution time&lt;br /&gt;Inbuilt web-server&lt;br /&gt;Does not force to install multiple web-servers &amp; language runtimes like other tools&lt;br /&gt;SSH Tunneling Support&lt;br /&gt;Get proactive alerts via email and SNMP Traps New.&lt;br /&gt;&lt;br /&gt;Suresh Kuna&lt;br /&gt;MySQL DBA</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/5955428798524733224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2010/01/monyog-mysql-monitor-and-advisor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/5955428798524733224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/5955428798524733224'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2010/01/monyog-mysql-monitor-and-advisor.html' title='MONyog MySQL Monitor and Advisor'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-5104683498282608225</id><published>2009-12-30T03:02:00.000-08:00</published><updated>2009-12-30T03:06:21.229-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="INNODB"/><category scheme="http://www.blogger.com/atom/ns#" term="SHOW INNODB STATUS"/><category scheme="http://www.blogger.com/atom/ns#" term="STATUS"/><title type='text'>SHOW INNODB STATUS walk through</title><content type='html'>The below URL explains the SHOW INNODB STATUS in detail&lt;br /&gt;http://www.mysqlperformanceblog.com/2006/07/17/show-innodb-status-walk-through/&lt;br /&gt;&lt;br /&gt;Suresh Kuna</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/5104683498282608225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/show-innodb-status-walk-through.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/5104683498282608225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/5104683498282608225'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/show-innodb-status-walk-through.html' title='SHOW INNODB STATUS walk through'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-4591342803072406240</id><published>2009-12-29T23:09:00.000-08:00</published><updated>2009-12-29T23:11:49.958-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="Ajax call"/><category scheme="http://www.blogger.com/atom/ns#" term="Asynchronous JavaScript and XML"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Ajax"/><title type='text'>What is Ajax ?</title><content type='html'>AJAX isn&#39;t a technology, or a language, and there&#39;s no recipe to implement it; it&#39;s just a combination of various components to achieve something you otherwise couldn&#39;t: asynchronous http requests. However, since early 2005, when Google and Flickr popularized the concept, its use has grown rapidly.&lt;br /&gt;&lt;br /&gt;The name AJAX is short for Asynchronous JavaScript and XML. It uses the JavaScript XMLHttpRequest function to create a tunnel from the client&#39;s browser to the server and transmit information back and forth without having to refresh the page. The data travels in XML format because it transmits complex data types over clear text.&lt;br /&gt;&lt;br /&gt;AJAX uses XHTML for the data presentation of the view layer, DOM, short for Document Object Model, which dynamically manipulates the presentation, XML for data exchange, and XMLHttpRequest as the exchange engine that ties everything together.&lt;br /&gt;&lt;br /&gt;Because of these requirements, AJAX works on I.E. 5.0+, Mozilla 1.0+, Firefox 1.0+, Netscape 7.0+, and Apple added it to Safari 1.2+.&lt;br /&gt;&lt;br /&gt;Traditional HTML sends a request to the server, which processes it and either returns a static HTML page or dispatches the request to some scripting language such as ColdFusion, which creates and returns an HTML page for the browser to render. When this method has to retrieve new data from the server it has to repost and reload another HTML file. In many cases perhaps only a small portion of the returned HTML code varies and the shell itself remains the same resulting in huge overhead because the data has to be downloaded every time.&lt;br /&gt;&lt;br /&gt;Some classic examples of applications that would benefit from AJAX are searching for information and displaying it back in a table, related select dropdowns, or checking if a user exists before submitting an entire form.&lt;br /&gt;&lt;br /&gt;The below url contains a detail implementation of how it works.&lt;br /&gt;http://ajax.sys-con.com/node/138966</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/4591342803072406240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/what-is-ajax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/4591342803072406240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/4591342803072406240'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/what-is-ajax.html' title='What is Ajax ?'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-3210182237822555202</id><published>2009-12-27T23:54:00.000-08:00</published><updated>2009-12-28T00:06:18.415-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DBConvert for Oracle and MySQL"/><title type='text'>DBConvert for Oracle and MySQL</title><content type='html'>Free tools for the Database conversion to Mysql.&lt;br /&gt;http://www.zdnetasia.com/downloads/pc/swinfo/0,39043052,39654405s,00.htm&lt;br /&gt;and http://dev.mysql.com/downloads//gui-tools/5.0.html&lt;br /&gt;The following are some of the key features of the MySQL Migration Toolkit:&lt;br /&gt;&lt;br /&gt; * The MySQL Migration Toolkit supports a variety of source database systems, including the following:&lt;br /&gt; o Oracle&lt;br /&gt; o Microsoft SQL Server&lt;br /&gt; o Microsoft Access&lt;br /&gt; o Sybase&lt;br /&gt; o MySQL&lt;br /&gt;   &lt;br /&gt; * The MySQL Migration Toolkit is fully customizable through its Java runtime interface. Advanced users can use Java to perform custom data and schema transformations.&lt;br /&gt; * The MySQL Migration Toolkit supports agent-based data migrations, with the MySQL Migration Toolkit residing on a separate machine than the source and target database servers, through the use of a special migration agent. The agent-based data migration improves migration performance by allowing data to be transferred directly from the source machine to the target machine without being routed through the MySQL Migration Toolkit.</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/3210182237822555202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/dbconvert-for-oracle-and-mysql.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3210182237822555202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/3210182237822555202'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/dbconvert-for-oracle-and-mysql.html' title='DBConvert for Oracle and MySQL'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-2099822450670402472</id><published>2009-12-23T00:26:00.000-08:00</published><updated>2009-12-23T00:27:58.027-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql cluster"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql cluster feature enhancements"/><title type='text'>Feature enhancements to MySQL Cluster</title><content type='html'>How important / useful would the following potential enhancements to MySQL Cluster be ?&lt;br /&gt;&lt;br /&gt;Running MySQL Cluster on Windows in a production environment&lt;br /&gt;Running MySQL Cluster within virtual machines in a production environment&lt;br /&gt;Improved performance for complex joins&lt;br /&gt;Support for Foreign Keys&lt;br /&gt;More than 128 columns per row&lt;br /&gt;More than 8 Kbytes of data (excluding BLOBs) per row&lt;br /&gt;Ability for indexes to be stored on disk rather than always in memory&lt;br /&gt;Improved performance for asynchronous (Geographic) replication (This does *not* refer to the synchronous replication between data nodes within a single Cluster).&lt;br /&gt;Disk-durable commits - the ability to specify that a transaction does not commit until the in-memory change has been persisted to disk (Latency would be impacted)&lt;br /&gt;Integrate MySQL Cluster backups with Enterprise backup solutions (e.g. Tivoli, NetBackup, HP DataProtector)&lt;br /&gt;XA Distributed commit&lt;br /&gt;Support for application and data nodes to run on machines with different endian architectures&lt;br /&gt;Allow MySQL Cluster to continue operations after a full node-group has been lost (Depending on configuration, a limited number of rows in each table would be unavailable when a full node group is lost)&lt;br /&gt;Allow effective use of more than 8 cores/hardware threads for a single data node&lt;br /&gt;On-line drop column&lt;br /&gt;Meta data (views, privileges etc.) shared between MySQL Servers&lt;br /&gt;Enhanced asynchronous (geographic) replication management&lt;br /&gt;MySQL Enterprise Monitor support for MySQL Cluster (including data nodes)&lt;br /&gt;Extend conflict resolution for asynchronous (geographic) replication to include deletes and inserts&lt;br /&gt;Extend conflict resolution for asynchronous (geographic) replication to remove requirement for application to manage Timestamps.&lt;br /&gt;Support for the Service Availability Framework (SAF)&lt;br /&gt;NDB API thread contention&lt;br /&gt;2 x Data Node (1 node group) configuration where application selects which data node should be responsible for each row (e.g. all rows active on the same data node)&lt;br /&gt;Variable sized VARCHARS on disk&lt;br /&gt;Improve OPTIMIZE TABLE command&lt;br /&gt;Enhanced memory use reporting&lt;br /&gt;Savepoints&lt;br /&gt;Support Map Reduce&lt;br /&gt;Increase security by allowing table data to be transparently encrypted and the key kept secure.&lt;br /&gt;SNMP support for traps&lt;br /&gt;SNMP support for management&lt;br /&gt;Backup a single database&lt;br /&gt;Filtering of NDB API events&lt;br /&gt;Abort transactions when disks become overloaded in order to avoid data nodes crashing</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/2099822450670402472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/feature-enhancements-to-mysql-cluster.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/2099822450670402472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/2099822450670402472'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/feature-enhancements-to-mysql-cluster.html' title='Feature enhancements to MySQL Cluster'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3118333704316399201.post-2747662909533256176</id><published>2009-12-23T00:10:00.000-08:00</published><updated>2009-12-23T00:18:55.620-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="engines"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql storage engines"/><category scheme="http://www.blogger.com/atom/ns#" term="storage"/><title type='text'>MySQL Storage Engines</title><content type='html'>Archive&lt;br /&gt;BerkeleyDB&lt;br /&gt;Blackhole&lt;br /&gt;CSV&lt;br /&gt;Example&lt;br /&gt;Falcon&lt;br /&gt;Federated&lt;br /&gt;InfoBright&lt;br /&gt;InnoDB&lt;br /&gt;Kickfire&lt;br /&gt;Maria&lt;br /&gt;Memory&lt;br /&gt;Merge&lt;br /&gt;MyISAM&lt;br /&gt;NDB&lt;br /&gt;PBXT&lt;br /&gt;TokuDB&lt;br /&gt;Custom Storage Engine</content><link rel='replies' type='application/atom+xml' href='http://sureshkuna.blogspot.com/feeds/2747662909533256176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/mysql-storage-engines.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/2747662909533256176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3118333704316399201/posts/default/2747662909533256176'/><link rel='alternate' type='text/html' href='http://sureshkuna.blogspot.com/2009/12/mysql-storage-engines.html' title='MySQL Storage Engines'/><author><name>Suresh Kuna</name><uri>http://www.blogger.com/profile/03528300969127611324</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>