son30 发表于 2018-9-28 08:03:41

MySQL - ERROR 1839

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 "timemytb.txt
用MySQL Workbench导出时,需如下操作:
1、 打开高级配置:
   

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


然后导出就OK了。

页: [1]
查看完整版本: MySQL - ERROR 1839