2

I cannot import a database in AWS RDS because of this commands in my sql file:

SET @@SESSION.SQL_LOG_BIN= 0;
SET @@GLOBAL.GTID_PURGED=/*!80000 '+'*/ '';
SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;

Are they important ? whiteout them there is no error.

log_bin_trust_function_creators parameter is set to 1 in a custom parameter.

FYI: MySql 5.7 and 8, same error

ERROR 1227 (42000) at line 20: Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470

1 Answers1

2
SET @@SESSION.SQL_LOG_BIN=0;

This is telling MySQL not to put these INSERT statements into the binary log. If you do not have binary logs enabled (not replicating), then it's not an issue to remove it. As far as I know, there is no way to enable this in RDS; I'm actually trying to figure out a way, which is how I found your question.

SET @@GLOBAL.GTID_PURGED=/*!80000 '+'*/ '';

Did you execute a RESET MASTER on the database where the dump originated from? Check here for an explanation of this value: gtid_purged

SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;

This is setting the @@SESSION.SQL_LOG_BIN variable back to the original setting; you should've seen another line like: SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;

If you're simply recovering this table into a new database that isn't writing to a binary log (for replication), it's safe to remove these lines. Hope this helps!

ChoNuff
  • 814
  • 6
  • 12