MySQL replication and time zones

Source: Internet
Author: User
Tags time zones

MySQL uses replication as the master node. if you add a trigger from the top, when the insert statement has now (), you need to add default-time-zone to the server startup Item. Otherwise, a time zone issue occurs.

 

16.4.1.31. replication and time zones


 

The same system time zone shoshould be set for both master and slave. Otherwise, statements depending on the local time on the master are not replicated properly, such as statements that use Now () OrFrom_unixtime () Functions. You can set the time zone in which MySQL server runs by using -- Timezone =Timezone_name Option ofMysqld_safe Script or by setting TZ Environment variable. See also section 16.4.1.14, "replication and system functions ".

If the master is MySQL 4.1 or earlier, both master and slave shoshould also use the same default connection time zone. that is, the -- default-time-zone parameter shocould have the same value for both master and slave.

Convert_tz (...,..., @ session. time_zone)Is properly replicated only if both master and slave are running MySQL 5.0.4 or newer.

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.