All HowTo's MySQL & MariaDB

Import data into AWS’s MySQL – clean it first

You’ve dumped a DB from MySQL and didn’t use the “–no-triggers” option. Now you’re trying to import your data into RDS MySQL which complains that:

ERROR 1227 (42000) at line xxx: Access denied; you need (at least one of) the SUPER privilege(s) for this operation

You can solve this by editing the dump file with ‘sed’ and then importing into RDS’s MySQL from your newly modified dump file.

sed -E 's/DEFINER=`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' dumpfile.sql > dumpfile_no_tags.sql


Leave a Reply

Your email address will not be published. Required fields are marked *