首页 > 数据库技术 > 详细

mysql常见错误解决办法

时间:2018-08-14 16:59:05      阅读:209      评论:0      收藏:0      [点我收藏+]

解决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常见错误解决办法

原文:http://blog.51cto.com/13120271/2159811

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!