MySQL日誌警告'[Warning] Unsafe statement written to the binary log'
測試環境的MySQL錯誤日誌裡面,出現警告資訊
[Warning] Unsafe statement written to the binary log
報錯原因:
資料庫的二進位制日誌格式為語句,在SQL語句中有DATE_ADD(NOW(), INTERVAL -30 MINUTE)時間函式。
這樣會導致從庫上面的語句執行結果可能不一致。
解決方法:
將二進位制日誌的格式設為ROW或MIXED。
[Warning] Unsafe statement written to the binary log
-
180510 11:15:00 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave. Statement: UPDATE ls_klass_subject ksubj
-
JOIN (
-
SELECT classSubjId, SUM(count) AS endCount
-
FROM ls_lesson
-
WHERE isDeleted = 0
-
AND isEnd = 0
-
AND endTime < DATE_ADD(NOW(), INTERVAL -30 MINUTE)
-
GROUP BY classSubjId
-
) t
-
SET finish = IFNULL(finish,0)+ t.endCount,
-
modifiedBy =888,
-
modifiedOn = NOW()
- WHERE ksubj.classSubjId =t.classSubjId AND ksubj.isDeleted = 0
報錯原因:
資料庫的二進位制日誌格式為語句,在SQL語句中有DATE_ADD(NOW(), INTERVAL -30 MINUTE)時間函式。
這樣會導致從庫上面的語句執行結果可能不一致。
解決方法:
將二進位制日誌的格式設為ROW或MIXED。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2154288/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysql關於二進位制日誌binary log的總結MySql
- MySQL Binary LogMySql
- MySQL重做日誌(redo log)MySql
- mysql關於ib_logfile事務日誌和binary log二進位制日誌的區別MySql
- 【Mysql】三大日誌 redo log、bin log、undo logMySql
- MySQL 日誌系統 redo log、binlogMySql
- Log日誌
- mysql日誌:redo log、binlog、undo log 區別與作用MySql
- mysql之 slow log 慢查詢日誌MySql
- MySQL Slow Query log(慢查詢日誌)MySql
- Python 日誌(Log)Python
- log 日誌原理
- 2、MySQL錯誤日誌(Error Log)詳解MySqlError
- WARNING: Logging before InitGoogleLogging() is written to STDERR 解決辦法Go
- Linux C日誌logLinux
- Log 工具列印日誌
- 必須瞭解的mysql三大日誌-binlog、redo log和undo logMySql
- MySQL更新資料時,日誌(redo log、binlog)執行流程MySql
- MySQL:簡單記錄刪除binary log的介面MySql
- Oracle listener log 日誌分析方法Oracle
- 日誌追蹤:log增加traceId
- c# Log 日誌 以及不列印重複LogC#
- Mysql日誌MySql
- 關閉VS警告 warning C4996996
- Python怎樣忽略warning警告錯誤?Python
- 【MySQL日誌】MySQL日誌檔案初級管理MySql
- Mysql 錯誤日誌出現大量[Warning] Aborted connection to db user host的解決思路MySql
- MySQL Binlogging Fails With Writing One Row To The Row-based Binary Log FailedMySqlAI
- django開發-log日誌的配置Django
- log4net日誌記錄
- kafka-log日誌程式碼解析Kafka
- 在python程式碼 出力log日誌Python
- mybatis log sql日誌輸出外掛MyBatisSQL
- linux 日誌log檔案 截斷Linux
- MySQL 五 日誌MySql
- Mysql 日誌管理MySql
- MySQL(3)-日誌MySql
- listener_scan1.log、listener.log監聽日誌清理