1. Phenomenon
When mysql uses a sql file to import the database, it prompts ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
Note: The mysql database has just been installed, and master-slave replication has never been configured, nor has master-slave replication of GTID been configured.
2. Solution
After consulting the online information, after testing, I found that the following method can solve my problem
Enter mysql Mode, reset master
# mysql -u root -p
Enter password
mysql> reset master;
After exiting, re-import, OK. Just let the machine import the data by itself.
The above is the detailed content of Solution to error 1840 in mysql. For more information, please follow other related articles on the PHP Chinese website!