MySQL Replicated time zone issues

Source: Internet
Author: User
Tags modify mysql

Received a demand today, said to be in the international for MySQL to establish replication. This is really nothing, the network environment is worse, MySQL is also able to deal with. But the time zone problem happens to be wrong!

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.00000 1 ' at position 48920, error_code:1597

Slave cannot get master's clock,mysql time_zone variable by default equals =system that is the system's time zone. Modify the time zone mode: Set global time_zone= ' +00:00 ' or set global time_zone= ' -11:00 '; simply modifying the DB's time zone can cause local program clutter and ultimately the decision to modify the system's time zone. The problem was given to our operation (Crontab's time zone), which was later reset to DB.

Here is a simple summary of the establishment of replication considerations:

1, server_id to the only

2, Binlog and relay_log names to be customized. Cannot use Hostname.log (when modifying system hostname may cause database to not start)

3, the database time zone should be consistent

4, for the dedicated users to replicate the master and slave on the same time to establish the account (easy failover, for future automation to prepare)

5, for the slave end of the database filtering, it is recommended to use: replicate__wild_do_table (so for the statement mode of replication does not need to consider whether to use the effect of using the statement. can refer to: http://weipengfei.blog.51cto.com/1511707/1070485

This article is from the "Technology Achievement Dream" blog, please be sure to keep this source http://weipengfei.blog.51cto.com/1511707/1170332

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/MySQL/

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.