Solve master/slave replication interruption caused by mysql_upgrade

Source: Internet
Author: User

The master/slave replication interruption caused by mysql_upgrade solves the problem of processing the 1548-Cannot loadfrom mysql on the master server in the production environment. proc. the table is probably successfully upted, and an alarm is reported, server Load balancer Server replication interruption view Server Load balancer status mysql> show slave status the following statement execution error is found: drop databaseif exists performance_schema is the database related to mysql's built-in performance information. How can mysql perform this operation, check the Error log [root @ db25522] # tail-n 500/data/my2/mysql/db25522.err 13051310: 29: 54 [Note] Error reading relay log eve Nt: slave SQL thread was killed 13051310: 29: 54 [ERROR] Error reading packet from server: Lost connection to MySQLserver during query (server_errno = 2013) 13051310: 29: 54 [Note] Slave I/O thread killed while reading event 13051310: 29: 54 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.002734 ', position 1017737307 13051310: 29: 57 [Note] Slave I/O thread: connected to master 'repl @ xxx. xxx. xxx. Xxx: 100', replicationstarted in log 'mysql-bin.002734 'at position 3306 1017737307: 29: 57 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.002734 'at position 1017729051, relay log'/my/rlog/relay-bin.000764' position: 1017729197 13053015: 00: 53 [ERROR] Incorrect definition of table mysql. proc: expected column 'comment' at position 15 to have type text, found type char (64 ). 13053015: 00: 53 [ERROR] Slave SQL: Query caused differenterrors on master and slave. error on master: message (format) = 'cannot load from mysql. % s. the tableis probably successfully upted 'error code = 1548; error on slave: actual message = 'noerror', Error code = 0. default database: 'performance _ scheme '. query: 'drop database if exists performance_schema ', Error_code: 0 13053015: 00: 53 [Warning] Slave: Cannot Load from mysql. proc. the table is probablyincluupted Error_code: 1548 13053015: 00: 53 [ERROR] Error running query, slave SQL thread aborted. fix theproblem, and restart the slave SQL thread with "SLAVE START ". we stoppedat log 'mysql-bin.002947 'position 721651903 is not caused by inconsistent data? The master server has the performance_schema database, but the slave server does not. Before mysql_upgrade-uroot is executed, master-slave replication is running, and the operation is judged to occur after the mysql_upgrade-uroot, analyze the log on the master, during this period, mysql performed those operations [root @ db25522] # mysqlbinlog -- no-defaults -- start-date = '2017-05-2013: 00: 00' -- end-date = '2017-05-2013: 03: 00' mysql-bin.002947>/root/tmp. [root @ db25522] # vi/root/tmp. log/DROP /*! */; # At721651876 #13053015: 00: 25 server id 13084 end_log_pos721651903 Xid = 435509540 COMMIT /*! */; # At 721651903 #13053015: 00: 53 server id 13084 end_log_pos721652022 Query thread_id = 418930 exec_time = 0 error_code = 1548 SETTIMESTAMP = 1369897253 /*! */;/*! \ Cutf8 *//*! */; SET @ session. character_set_client = 33, @ session. collation_connection = 33, @ session. collation_server = 28 /*! */; Drop database if exists performance_schema /*! */; # At721652022 #13053015: 00: 53 server id 13084 end_log_pos721652152 Query thread_id = 418930 exec_time = 0 error_code = 0 SETTIMESTAMP = 1369897253 /*! */; CREATEDATABASE performance_schema character set utf8 /*! */; # At721652152 #13053015: 03: 19 server id 13084 end_log_pos721652223 Query thread_id = 418956 exec_time = 0 error_code = 0 SETTIMESTAMP = 1369897399 /*! */;/*! \ Cgbk *//*! */; SET @ session. character_set_client = 28, @ session. collation_connection = 28, @ session. collation_server = 28 /*! */; BEGIN /*! */; # At721652223 #13053015: 03: 19 server id 13084 end_log_pos721652336 Query thread_id = 418956 exec_time = 0 error_code = 0 usePriceDB /*! */; SETTIMESTAMP = 1369897399 /*! */; Well, the red part above executes this operation and then looks at the slave ERROR Log 13053015: 00: 53 [ERROR] Incorrect definition of table mysql. proc: expected column 'comment' at position 15 to have type text, found type char (64 ). 13053015: 00: 53 [ERROR] Slave SQL: Query caused different errors on master andslave. error on master: message (format) = 'cannot load from mysql. % s. the table is probably updated upted 'errorcode = 1548; Error on slave: actual mes Sage = 'no error', error code = 0. defaultdatabase: 'performance _ scheme '. query: 'drop database if EXISTSperformance_schema ', Error_code: 0 13053015: 00: 53 [Warning] Slave: Cannot load from mysql. proc. the table is probablyincluupted Error_code: 1548 13053015: 00: 53 [ERROR] Error running query, slave SQL thread aborted. fix the problem, and restart the slave SQL thread with "SLAVE START ". we stopped atlog The log error of 'mysql-bin.002947 'position 721651903 5.5 is still user-friendly. The location of the binlog log file read when the slave is stopped is clear. This provides convenience for restart slave. Since the error is caused by drop database ifexists performance_schema, skip this event. Slave server: mysql> show variables like '% skip %'; mysql> setglobal SQL _slave_skip_counter = 1; mysql> slave start; copy normal Summary: although the copy is normal. Why does mysql_upgrade perform the drop database if EXISTSperformance_schema operation? I hope to have friends with similar problems to communicate with each other.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.