Importing a MySQL database is a common requirement in several Magento 2 scenarios, such as setting up a staging environment, migrating a website from one server to another, restoring data from a backup after a loss, or transferring data between environments.
One of the errors you encounter is while importing a database or mysql dump that says “ERROR 1193 (HY000) at line X: Unknown system variable ‘GTID_PURGED” ?
Use the below solution to get it resolved:
Fix “Unknown System Variable ‘GTID_PURGED’” Error When Importing MySQL Dump
Open your SQL file and search for the following line.
SET @@GLOBAL.GTID_PURGED = ‘xxxxxx’;
or
SET GLOBAL GTID_PURGED=’…’;
Then, remove this line completely, save the file and import the database again.
Such an error happens in the case when the GTID_PURGED value is not supported in your current MySQL or MariaDB version.
This simple solution will resolve the error.