When I attempt to import data to an Amazon RDS MySQL instance using mysqldump, I get an error similar to the following:

Definer error: example: /*!50003 CREATE*/ /*!50017 DEFINER=`rdsadmin`@`localhost`*/ /*!50003 TRIGGER customer_update AFTER UPDATE ON `customer` FOR EACH ROW

How do I fix this?

Definer errors are triggered when MySQL attempts to create an object under a DB user, and the DB user doesn't exist on the destination database. The same thing applies when it tries to create a user for localhost, which is not permitted for RDS, because RDS does not have superuser privileges.

Definer errors can be addressed in multiple ways:

  • Remove the following definer line:

/*!50017 DEFINER=`rdsadmin`@`localhost`*/

The line should now read as follows:

/*!50003 CREATE*/ /*!50003 TRIGGER customer_update AFTER UPDATE ON `customer` FOR EACH ROW

  • Rename the definer users “rdsadmin” and “localhost” to “masteruser”/ and “%”, respectively:

/*!50003 CREATE*/ /*!50017 DEFINER=`masteruser`@`%`*/ /*!50003 TRIGGER customer_update AFTER UPDATE ON `customer` FOR EACH ROW

  • Create or re-create the dump file without the definer option.

Most MySQL clients provide the option to ignore the definer during the creation of the mysqldump file. See the documentation for your preferred MySQL client for instructions on how to create a dump file without the definer option.

Amazon RDS, MySQL, mysqldump, definer error, access denied


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center.

Published: 2016-06-27