mysql常见错误解决办法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql常见错误解决办法相关的知识,希望对你有一定的参考价值。
解决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遇到的问题后续还会补充。
以上是关于mysql常见错误解决办法的主要内容,如果未能解决你的问题,请参考以下文章