MySQL – Fix ERROR 1449 When Restoring Dump

linuxMySQLmysql-5.5mysql-5.6mysqldump

I took hot backup (dump) from my Master MySQL DB with below command

mysqldump -uroot -p –skip-lock-tables –single-transaction –flush-logs –hex-blob –master-data=2 -A > ~/dump.sql

Master Version: MySQL-server-5.5.41-1.el6.x86_64

At the time of restoration on slave we are getting this error, have I done something wrong.

[root@Slave ~]$ mysql -u root -p < dump.sql
Enter password:
ERROR 1449 (HY000) at line 150536: The user specified as a definer ('lipl_ga_app'@'%') does not exist

Slave Version: mysql-community-server-5.6.28-2.el6.x86_64

The DB is huge and we don't want to start the restoration process again.

@ Nawaz Sohail I have taken backup of mysql user from below command

mysqldump -u root -p mysql user > user_table_dump.sql

Restored

mysql -u root -p mysql < user_table_dump.sql

Best Answer

I tried to solve this in many ways but, didn't find any workaround. then I tried to redo the whole thing again with the below steps.

I took a backup of mysql user from Master Host,

mysqldump -u root -p mysql user > user_table_dump.sql

and restored mysql user on slave,

mysql -u root -p mysql < user_table_dump.sql

then I restored the master dump on slave.

[root@Slave ~]$ mysql -u root -p < dump.sql

The master dump restored without any error.

Related Question