修改mysql 表引擎类型错误

mysql引擎默认类型为MyISAM,

mysql>show engines;

事务隔离机制为:READ-COMMITTED(/etc/my.cnf查看)

默认建表如果不指定引擎类型,自动为MyISAM。此时想更改表为InnoDB类型。用户登陆到mysql客户端执行:
mysql>alter table ATT engine = InnoDB;

则报错:
ERROR 1598 (HY000): Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'。

解决办法:
运行该命令即可:SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;

上面方法治标不治本!
这种方式强行修改了表的引擎类型,会导致表插入数据失败,依然提示错误:
Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'.
解决办法:/etc/my.cnf添加参数:
binlog_format = ROW
innodb_locks_unsafe_for_binlog = 1


你可能感兴趣的:(mysql,binlog,类型)