国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

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

2024-07-24 13:09:31
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了MySQL:Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEM,需要的朋友可以參考下
 

1:錯誤日志大量錯誤

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
  

2:原因:

查了下原因,tab_name 這個表上有2個唯一鍵。則使用INSERT … ON DUPLICATE KEY UPDATE ,且當前數據庫binlog_format是statement格式,這種sql語句就會報unsafe。
  

官方手冊:

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.
  

解決方法:

把binlog_format設置為ROW或者STATEMENT或者修改SQL。



注:相關教程知識閱讀請移步到MYSQL教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 和田市| 青浦区| 元氏县| 阿瓦提县| 肥城市| 即墨市| 德阳市| 桃园县| 商南县| 资源县| 富锦市| 名山县| 明水县| 青河县| 溧水县| 北票市| 沈阳市| 杨浦区| 平度市| 琼中| 丹江口市| 当雄县| 探索| 灵川县| 朔州市| 凯里市| 南昌县| 库尔勒市| 尼玛县| 黔西| 如皋市| 贵阳市| 石屏县| 皋兰县| 永德县| 华蓥市| 桐庐县| 松潘县| 石林| 延庆县| 宁德市|