Centos下_MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: Got error: 1449: The user specified as a definer ('fk_system'@'localhost') does not exist when using LOCK TABLES
在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下
[root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local/mysql/bin/mysqldump -uroot -pmyServerPwd# dateabase > /data/mysql_bak/bak_test.sql
执行完命令并没有出现备份文件,报错
mysqldump: Got error: 1449: The user specified as a definer ('fk_system'@'localhost') does not exist when using LOCK TABLES
解决方案:
通过命令进入mysql,执行以下命令
grant select,insert,update,delete on mchome.* to 'fk_system'@'localhost' identified by 'fk_system';
再次执行备份命令。OK文件生成~