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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 警告日誌檔案alert_.log
- mysql關於ib_logfile事務日誌和binary log二進位制日誌的區別MySql
- mysql關於二進位制日誌binary log的總結MySql
- Oracle 警告日誌 (alert log) 中包含哪些內容 ?Oracle
- MySQL 的日誌:binlogMySql
- MySQL重做日誌(redo log)MySql
- mysql清除binlog日誌MySql
- MySQL的binlog日誌MySql
- 清除MySQL Binlog日誌MySql
- MySQL Binary LogMySql
- MySQL 日誌系統 redo log、binlogMySql
- mysql binlog日誌刪除MySql
- Mysql-binlog日誌-TMySql
- Mysql Binary Log (1)MySql
- Mysql Binary Log (2)MySql
- 【Mysql】三大日誌 redo log、bin log、undo logMySql
- WARNING: Logging before InitGoogleLogging() is written to STDERR 解決辦法Go
- MySQL四種日誌binlog/redolog/relaylog/undologMySql
- Oracle之外部表警告日誌Oracle
- mysql日誌:redo log、binlog、undo log 區別與作用MySql
- mysql之 slow log 慢查詢日誌MySql
- Mysql 事務日誌(Ib_logfile)MySql
- MySQL 正確刪除 binlog 日誌MySql
- mysql檢視binlog日誌詳解MySql
- MySQL Slow Query log(慢查詢日誌)MySql
- 實時備份mysql binlog日誌MySql
- Log日誌
- mysql的binary-log操作MySql
- oracle 11g的警告日誌Oracle
- 2、MySQL錯誤日誌(Error Log)詳解MySqlError
- 利用binlog日誌恢復mysql資料MySql
- MySQL--binlog日誌恢復資料MySql
- [MySQL binlog]徹底解析Mixed日誌格式的binlogMySql
- Mysql之binlog日誌說明及利用binlog日誌恢復資料操作記錄MySql
- Weblogic日誌Web
- log 日誌原理
- 刪除oracle 11g的警告日誌和監聽日誌Oracle
- alert日誌中出現ash size的警告