Binlog innodb 問題解決


錯誤:

1
ERROR Log: binary logging not possible. message: transaction level 'read-committed' in innodb is not safe for binlog mode 'statement'

原因: 當 binlog_format 為 statement 時, read committed 會發生錯誤!!!
解決: (推薦方法4)

1
2
3
4
5
6
方法1.mysql> set session transaction isolation level REPEATABLE READ ; REPEATABLE READ ;
方法2. mysql> set session binlog_format=row;
方法3. mysql> set session binlog_format= mixed;
方法4. my.cnf 增加底下兩行,再 restart MySQL
binlog_format=mixed [OR] row
innodb_locks_unsafe_for_binlog=1

參考: http://havefundb.blogspot.com/2010/10/mysql-innodb-binlog-mode_14.html