When I attempt to import data to an Amazon Relational Database Service (Amazon RDS) for MySQL instance using mysqldump, I receive 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

Definer errors are triggered when MySQL attempts to create an object under a database user, and that database user doesn't exist on the destination database. You might receive a similar error when MySQL attempts to create a user for localhost, which is not permitted for Amazon RDS, because Amazon RDS doesn't have superuser privileges.

Definer errors can be addressed in multiple ways:

1.    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

2.    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

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

The MySQL dump utility doesn't provide the option to remove a DEFINER. Some MySQL clients provide the option to ignore the definer when creating a logical backup, but this doesn't occur by default. Review the documentation for your preferred MySQL client to see if the option to ignore the DEFINER is available. The MySQL command line client is unable to exclude the definer; however, the client can be used with third-party tools to remove the DEFINER or to find and replace the user name and host.


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

Updated: 2018-07-02