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常见错误解决办法的主要内容,如果未能解决你的问题,请参考以下文章

Windows下MySql错误代码1045的解决方法

PHP编译安装时常见错误解决办法,php编译常见错误

RabbitMQ Cluster 常见错误码原因与解决办法

POST请求常见错误及解决办法

mysql Access denied for user root@localhost错误解决方法总结(转)

SSL证书常见错误和解决办法