When you download a logical backup from an RDS MySQL 5.6 instance to an apsaradb for RDS instance or an on-premises database, the following errors occur. The error codes are 1227 and 1725.
[Err] 1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation-common in RDS MySQL 5.6
ERROR 1725 (HY000) at line 1936: OPERATION need to be executed set by ADMIN-common in RDS MySQL 5.5
ERROR 1227 (42000) at line 2984: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
When you import data to the RDS for MySQL instance, the SQL statement contains one or more SQL statements that require the Super permission to run. The RDS for MySQL instance does not provide the Super permission to run such SQL statements. Therefore, you must delete these SQL statements.
DEFINER=`root`@`%`
sed -ie 's/DEFINER[ ]*=[ ]*[^ ]*/ / 'your.sql
SET @@GLOBAL.GTID_PURGED='d0502171-3e23-11e4-9d65-d89d672af420:1-373, d5deee4e-3e23-11e4-9d65-d89d672a9530:1-616234';
awk '{ if (index($0,"GTID_PURGED")) { getline; while (length($0) > 0) { getline; } } else { print $0 } }' your.sql | grep -iv 'set @@' > your_revised.sql