Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud sql database export import issue

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?

like image 867
bjorndv Avatar asked Nov 25 '25 16:11

bjorndv


1 Answers

(In an SQL Editor) run RESET MASTER on the database you're importing to.

issuing RESET MASTER resets the GTID execution history.

https://dev.mysql.com/doc/refman/5.7/en/reset-master.html

like image 162
Mujeeb Avatar answered Nov 28 '25 17:11

Mujeeb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!