centos7.5 binlog恢复数据失败
问题:
mysql> \. /tmp/inc.sql
ERROR 1050 (42S01): Table 'new_1' already exists
ERROR 1666 (HY000): Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.
原因:
新库用的binlog是statement模式,导入的是row模式的binlog
解决方法:
设置新库的binlog模式为row
[root@db01-51 ~]# vim /data/3307/my.cnf
[mysqld]
log-bin=mysql-bin
binlog_format=row
重启新数据库,再次导入就没有问题