MYSQL uuid ()

Source: Internet
Author: User

MySQL did a timed execution of the event, found that the original work, and now not.

Call the error log file in/var/lib/mysql and find a sentence:

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.

The current MySQL version is low, and the UUID function does not support the statement mode of MySQL replication.

Change the code first to ensure compatibility with the lower version:

BEGIN
--The UUID function is a nondeterministic function, which does not support the statement mode of MySQL replication, but supports mixed, row two modes
--in Copy mode, the UUID () function is required, so you must use the method of copy-based row/blend mode.
Set binlog_format = MIXED;
Insert into Users (username,guid,userpinyin,userpy,uper)
Select DISTINCT userName, UUID (), To_pinyin (UserName), TO_PINYINSX (UserName), Domain from T_zhangdan a
Where NOT EXISTS (select 1 from Users where username=a.username);
END

MYSQL uuid ()

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.