mysql> show create database dbadoudou\G; *************************** 1. row *************************** Database: dbadoudou Create Database: CREATE DATABASE `dbadoudou` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */ 1 row in set (0.00 sec)
ERROR: No query specified ## DATABASE DEFAULT CHARACTER SET utf8 COLLATE utf8_bin and [mysqld] character-set-server=utf8 ## collation-server=utf8_bin the same
mysql> use dbadoudou; Database changed mysql> create table dbadoudou -> ( -> id int(4) not null auto_increment, -> name char(20) not null, -> primary key (id) -> ); Query OK, 0 rows affected (4.36 sec)
-------------------------------------------------------------------------------------+ 1 row in set (0.00 sec)
## TABLE DEFAULT CHARSET=utf8 COLLATE=utf8_bin AND [mysqld] character-set-server=utf8 ## collation-server=utf8_bin the same
mysql> insert into dbadoudou (name) values('dbadoudou'),('ocmxiaoyu'),('ocmdream'); 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. ## CAUSE: ERROR 1665 (HY000) SOLUTION: SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
mysql> show global variables like 'binlog_format'; +---------------+-----------+ | Variable_name | Value | +---------------+-----------+ | binlog_format | STATEMENT | +---------------+-----------+ 1 row in set (0.00 sec) mysql> SELECT @@session.tx_isolation, @@global.tx_isolation; +------------------------+-----------------------+ | @@session.tx_isolation | @@global.tx_isolation | +------------------------+-----------------------+ | READ-COMMITTED | READ-COMMITTED | +------------------------+-----------------------+ 1 row in set (0.00 sec) mysql> SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; Query OK, 0 rows affected (0.00 sec)