3
votes

When exporting an sql database from an instance (2nd gen) and importing it on another sql instance, I get the following error: ERROR 1839 (HY000) at line 24:

@@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_MODE = ON.

According to https://superuser.com/questions/906843/import-mysql-data-failed-with-error-1839 this could be solved by making an sql dump with

--set-gtid-purged=OFF

But the gcloud sql instances export command does not support this. Is there another way to solve this issue?

1

1 Answers

3
votes

would you try the following two ways?

Option 1) Remove this line from the sql dump file, and import it to your database? SET @@GLOBAL.GTID_PURGED='1b313522-1ee5-11e6-9c51-0242ac110003:1-2020';

Option 2) turn off binary logging on your instance, then do the export?

Reference Article