解决mysql利用二进制日志恢复数据报错:ERROR 1781 (HY000) at line 16: @@SESSION.GTID_NEXT cannot be set to UUID:NUMBER when @@GLOBAL.GTID_MODE = OFF.
解决办法:
配置gtid选项
配置前:
mysql> show global variables like ‘gtid_mode‘;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 24
Current database: gold
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| gtid_mode | OFF |
+---------------+-------+
1 row in set (0.10 sec)
配置后:
mysql> set @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;
mysql> show global variables like ‘gtid_mode‘;
+---------------+----------------+
| Variable_name | Value |
+---------------+----------------+
| gtid_mode | OFF_PERMISSIVE |
+---------------+----------------+
1 row in set (0.00 sec)
解决ERROR 1062 (23000): Duplicate entry ‘4‘ for key ‘PRIMARY‘
配置前:
解决:
mysql 修改主键自增长
alter table test change id id int AUTO_INCREMENT;
ok,mysql遇到的问题后续还会补充。