Mysql入门MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEM

Mysql入门MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEM,第1张

概述介绍《Mysql入门MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEM》开发教程,希望对您有用。

《MysqL入门MysqL:Unsafe statement written to the binary log using statement format since binlog_FORMAT = STATEM》要点:
本文介绍了MysqL入门MysqL:Unsafe statement written to the binary log using statement format since binlog_FORMAT = STATEM,希望对您有用。如果有疑问,可以联系我们。

1:错误日志大量错误MysqL教程

150602 14:40:02 [Warning] Unsafe statement written to the binary log using statement format since binlog_FORMAT = STATEMENT. INSERT... SELECT... ON DUPliCATE KEY UPDATE is unsafe because the order in which rows are retrIEved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave. Statement:INSERT INTO tab_name
  MysqL教程

2:原因:MysqL教程

查了下原因,tab_name 这个表上有2个唯一键.则使用INSERT … ON DUPliCATE KEY UPDATE,且当前数据库binlog_format是statement格式,这种SQL语句就会报unsafe.
  MysqL教程

官方手册:MysqL教程

INSERT … ON DUPliCATE KEY UPDATE statements on tables with multiple primary or unique keys.When executed against a table that contains more than one primary or unique key,this statement is consIDered unsafe,being sensitive to the order in which the storage engine checks the keys,which is not deterministic,and on which the choice of rows updated by the MysqL Server depends.
  MysqL教程

解决方法:MysqL教程

把binlog_format设置为ROW或者STATEMENT或者修改sql.MysqL教程

一般情况下就是MysqL配置问题,大家可以参考这篇文章:/article/84357.htmMysqL教程

总结

以上是内存溢出为你收集整理的Mysql入门MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEM全部内容,希望文章能够帮你解决Mysql入门MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEM所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1163046.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存