1. 程式人生 > >MySQL使用過程中遇到的小問題(積累篇)

MySQL使用過程中遇到的小問題(積累篇)

問題一:Caused by: java.sql.BatchUpdateException: Cannot execute statement: impossible to write to binary log      since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.     InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.

    首先了解一下:     

     #檢視事務隔離級別   select @@tx_isolation;      #檢視binlog方式       select @@binlog_format;

    #設定session級別的BINLOG   SET SESSION binlog_format = 'MIXED' ;

    #設定系統級別的binlog        SET GLOBAL binlog_format = 'ROW';

       檢視mysqld的binlog方式設定成最下面兩行語句,或者到mysql的配置檔案中將binlog_format=mixed前邊的#去掉。然後重啟     mySQL服務。