The difference between now and sysdate in MySQL

Source: Internet
Author: User

MySQL now gets the time of SQL execution, Sysdate gets the system time

Errors can result from inconsistent time in master and slave master and slave processes

For example:

Unsafe statement written to the binary log using statement format since Binlog_format = statement. Statement is unsafe because it uses a system function, that could return a different value on the slave.


Workaround:

1, fix this problem.

2, do not use the statement statement-level replication, but similar to Oracle, the data changes are recorded, as is done in the standby library.

The second way is the familiar, Binlog_format=row way. The first is that now () does not use the machine system time, but instead takes the MySQL variable "TIMESTAMP" value.

Other similar variables include insert_id (for copying, auto_increment value), etc.


The difference between now and sysdate in 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.