MySQL replication Time Zone

Source: Internet
Author: User

Today, I received a requirement to establish a replication mechanism for MySQL internationally. This is actually nothing, and the network environment is worse, MySQL can also cope with it. However, a time zone error occurs!

The error is as follows:

[Warning] Slave I/O: Get master clock failed with error: Lost connection to MySQL server during query, Error_code: 2

[Warning] Slave I/O: Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again, log '1. 100' at position 000001, Error_code: 48920

Slave cannot obtain the clock of the master. The MySQL time_zone variable defaults to = SYSTEM, that is, the SYSTEM time zone is used. Modify the time zone: set global time_zone = '+' or set global time_zone = '-'. Simply modifying the time zone of the database can cause local program confusion, finally, we decided to modify the system time zone. This problem is handed over to our O & M (the time zone of crontab should also be handled), and then we can restart the database.

Here is a brief summary of the precautions for establishing replication:

1. server_id must be unique.

2. binlog and relay_log names must be customized. The hostname. log cannot be used. (when the system hostname is modified, the database may fail to be started)

3. Database time zones must be consistent

4. For dedicated replication users, they must create accounts on the master and slave at the same time (to facilitate failover and prepare for future automation)

5. We recommend that you use replicate _ wild_do_table when filtering the database on the slave side. (In this way, you do not need to consider whether to use the use statement for statement mode replication. Refer:

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.