码迷,mamicode.com
首页 > 数据库 > 详细

MySQL - ERROR 1839

时间:2016-05-23 01:16:10      阅读:1360      评论:0      收藏:0      [点我收藏+]

标签:微软雅黑   normal   justify   error   style   

1.1.1  现象

导出的数据库在导入时,出现如下错误:

ERROR 1839 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_MODE = ON.

1.1.2  原因

gtid_executed:

WHEN used WITH global scope, this variable contains a representation OF the SET OF ALL transactions that are logged IN the BINARY log.

WHEN used WITH SESSION scope, it contains a representation OF the SET OF transactions that are written TO the cache IN the CURRENT SESSION.

Issuing RESET MASTER causes the global VALUE (but NOT the SESSION VALUE) OF this variable TO be reset TO an empty string.

1.1.3  解决

dump的时候加上参数–gtid-mode=OFF,类似如下:

mysqldump -h1.1.1.1  -uuser   -ppassword   -P3306 mydb mytb –where "time <= cast(‘2014-04-03 16:00‘ as datetime)" –skip-lock-tables –default-character-set=utf8 –gtid-mode=OFF > mytb.txt

MySQL Workbench导出时,需如下操作:

1、 打开高级配置:

     技术分享

2、 配置-gtid-pruged参数为OFF

技术分享 

然后导出就OK了。

MySQL - ERROR 1839

标签:微软雅黑   normal   justify   error   style   

原文地址:http://lancelot.blog.51cto.com/393579/1775928

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!