標籤:微軟雅黑 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、 開啟進階配置:
650) this.width=650;" title="4" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="4" src="http://s3.51cto.com/wyfs02/M00/80/70/wKiom1dBgAWAaYF5AABr9mQql9A184.png" width="410" height="170" />
2、 配置-gtid-pruged參數為OFF
650) this.width=650;" title="5" style="border-left- 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px" border="0" alt="5" src="http://s3.51cto.com/wyfs02/M00/80/6E/wKioL1dBgSuRSkzSAADipz7RXKk163.png" width="357" height="283" />
然後匯出就OK了。
MySQL - ERROR 1839