方法一:在目標mysql上執行如下命令
1.進入mysql 執行 reset master;
mysql> reset master
-> ;
Query OK, 0 rows affected (0.03 sec)
mysql> exit;
Bye
方法二:到導入時添加參數-f
Warning: Using a password on the command line interface can be insecure.
ERROR 1839 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_MODE = ON.
報錯原因是原數據庫里開了gtid,需要在mysqldump語句里指定--set-gtid-purged=on參數;
在導入的時候加入-f參數即可,例如:
mysql -uroot -pSunstar2012Hecom888ser8686 -h47.93.xx.xx -f cus_DEMO < /alidata1/backup/gl/gl/cus_DEMO_gl.sql
轉載:http://blog.itpub.net/20893244/viewspace-2138125/