mysqldump: Got error: 1449: The user specified as a definer ('root'@'%') does not exist when using LOCK TABLES

当出现下面错误时:

mysqldump: Got error: 1449: The user specified as a definer ('root'@'%') does not exist when using LOCK TABLES

 

是权限问题,解决办法,执行两条SQL语句就好:

grant all privileges on *.* to root@"%" identified by ".";
flush privileges;

在命令中执行图:

mysql> grant all privileges on *.* to root@"%" identified by ".";
Query OK, 0 rows affected (0.00 sec)
 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
正在加载评论...