Thursday 27 October 2016

Mysql Database Import fails in AWS RDS : ERROR 1449 (HY000) at line 27101: The user specified as a definer ('dbadmin'@'%') does not exist

Mysql Database Import fails in AWS RDS 

Error message :

ERROR 1449 (HY000) at line 27101: The user specified as a definer ('dbadmin'@'%') does not exist


Syntax :

[ec2-user@ip-*******~]$ mysql -u***** -p***** PROD_DATABASE < PROD_DATABASE.SQL


Solution:

The AWS RDS doesnt store the 'localhost' term in the backed-up mysql dump.
localhost is replaced with '%'. Hence the dump file needs to be updated with localhost in all places it exists with username@'%'.


Update the dump file with 'localhost' to resolve.