DebugFactor.com | Forum

“ERROR 1227 (42000) at line 20: Access denied; you need (at least one of) the SUPER privilege(s) for this operation Operation failed with exitcode 1” while trying to import in mysql workbench

I am trying to clone a google cloud database by exporting it and then importing it into another SQL cloud server through MySQL WorkBench. I am getting the following error while running the import utility.

ERROR 1227 (42000) at line 20: Access denied; you need (at least one of) the SUPER privilege(s) for this operation Operation failed with exitcode 1

Option1
Mysql dump by default adds a lot of extra parameters which are nor really needed in most of the case. If you are not using global transactions, you can comment out these lines

-- SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;
-- SET @@SESSION.SQL_LOG_BIN= 0;

You may also have to find this line and comment it out

-- SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;

Option 2 (To avoid the error)
While exploring the DB, use this parameter so that these extra parameters are not added to the dump.

-set-gtid-purged=OFF

To diable this in MySQL workbench, in the Data Export window, in Advanced Options, set the value of “set-gtid-purged – Add ‘SET @@GLOBAL.GTID_PURGED’” to the output” to OFF.
image

This will result in

Running: mysqldump.exe --defaults-file="c:\users\xxx\appdata\local\temp\tmpr9jbzy.cnf"  --host=xx.xx.xx.xx --protocol=tcp --user=root --set-gtid-purged=OFF --port=3306 --default-character-set=utf8 --single-transaction=TRUE --routines --events --column-statistics=0 "databasename"