Percona MySQL 5.6 語句加鎖報錯"ERROR 1665 (HY000): Cannot execute statement"
mysql> select * from tab_with_index where id=1 for update;
ERROR 1665 (HY000): 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.
mysql> show variables like '%bin%format%';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| binlog_format | STATEMENT |
+---------------+-----------+
1 row in set (0.00 sec)
mysql> show variables like '%isolation%';
+---------------+----------------+
| Variable_name | Value |
+---------------+----------------+
| tx_isolation | READ-COMMITTED |
+---------------+----------------+
1 row in set (0.00 sec)
解決方法:
更改日誌的格式
mysql> set global binlog_format='mixed';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
mysql> show variables like '%bin%format%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | MIXED |
+---------------+-------+
1 row in set (0.00 sec)
mysql> select * from tab_with_index where id=1 for update;
+------+------+
| id | name |
+------+------+
| 1 | 1 |
| 1 | 4 |
+------+------+
2 rows in set (0.00 sec)
ERROR 1665 (HY000): 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.
mysql> show variables like '%bin%format%';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| binlog_format | STATEMENT |
+---------------+-----------+
1 row in set (0.00 sec)
mysql> show variables like '%isolation%';
+---------------+----------------+
| Variable_name | Value |
+---------------+----------------+
| tx_isolation | READ-COMMITTED |
+---------------+----------------+
1 row in set (0.00 sec)
解決方法:
更改日誌的格式
mysql> set global binlog_format='mixed';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
mysql> show variables like '%bin%format%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | MIXED |
+---------------+-------+
1 row in set (0.00 sec)
mysql> select * from tab_with_index where id=1 for update;
+------+------+
| id | name |
+------+------+
| 1 | 1 |
| 1 | 4 |
+------+------+
2 rows in set (0.00 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-2125783/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ERROR 1661 (HY000): Cannot execute statement: impossible to write to binaryError
- MySQL5.6:mysql_secure_installation 報錯ERROR 2002 (HY000)MySqlError
- 超全面 MySQL 語句加鎖分析(上篇)MySql
- 超全面 MySQL 語句加鎖分析(中篇)MySql
- 超全面 MySQL 語句加鎖分析(下篇)MySql
- Percona MySQL 5.6 主主複製環境報錯"Got fatal error 1236 from master.."MySqlGoErrorAST
- mysql innodb的行鎖(6) --不安全語句加鎖MySql
- MySQL 5.6修復從庫複製時報錯'ERROR 1872 (HY000): Slave failed to initialize'MySqlErrorAI
- MySQL 5.7 PREPARE、EXECUTE、DEALLOCATE語句介紹MySql
- mysql執行sql指令碼報錯ERROR 1366 (HY000) 解決MySql指令碼Error
- Statement (操作 SQL 語句)SQL
- Percona MySQL 5.6 HINT介紹MySql
- MySQL報錯ERROR 2013 (HY000): Lost connection to MySQL server during queryMySqlErrorServer
- 【MySQL】ERROR 1290 (HY000): --secure-file-priv--匯出報錯MySqlError
- mysql 5.6.25報錯ERROR 1372 (HY000): Password hash 的一點思考MySqlError
- MySQL 報錯 ERROR 1290 (HY000): running with the --secure-file-privMySqlError
- 一條簡單的更新語句,MySQL是如何加鎖的?MySql
- MySQL 5.6複製報錯Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND;MySqlError
- MySQL報錯'ERROR 2002 (HY000): Can't connect to local MySQL server through'MySqlErrorServer
- PL/SQL 中 execute immediate,select 語句沒有into 執行未報錯SQL
- ERROR 1548 (HY000): Cannot load from mysql.proc. The table is probably corruptedErrorMySql
- MySQL建立使用者報錯 ERROR 1396 (HY000): Operation CREATE USER failed for 'afei'@'%'MySqlErrorAI
- MySQL 預處理語句prepare、execute、deallocate的使用MySql
- Mysql 報The MySQL server is running with the --secure-file-priv option so it cannot execute this stat...MySqlServer
- 【MySQL】部分5.6版本罕見覆制報錯 ERROR 1837MySqlError
- mongodb錯誤解決辦法-bash: ./mongod: cannot execute binary file: Exec format errorMongoDBORMError
- mysql5.6 mysqldump備份報錯MySql
- MySQL 5.7 建立使用者報錯 ERROR 1805 (HY000): Column count of mysql.user is wrongMySqlError
- Mysql連線錯誤ERROR 2003 (HY000)MySqlError
- MYSQL SOURCE報錯 ERROR: ASCIIMySqlErrorASCII
- PHP報錯:?configure: error: Cannot find libmysqlclientPHPErrorIBMMySqlclient
- ERROR 1786 (HY000): Statement violates GTID consistency: CREATE TABLE ... SELECTError
- SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-preparedSQLError
- mysql 8 報錯 ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repositoryMySqlErrorAIStruct
- mysql報錯ERROR 1093MySqlError
- super許可權報錯:ERROR1221(HY000):IncorrectusageofDBGRANTandGLOBALPRIVILEGESError
- Percona MySQL 5.6 RPM包方式安裝流程MySql
- mysql加鎖讀MySql