备份数据库
$ mysqldump -uroot -p db > backup/db.sql
上面的terminal 执行
出现了下面的错误
mysqldump: Got error: 1449: The user specified as a definer ('someuser'@'%') does not exist when using LOCK TABLES
主要原因:当前用户没有备份该数据库的权限。
解决方法:
GRANT ALL ON *.* TO 'someuser'@'%' IDENTIFIED BY 'complex-password';
FLUSH PRIVILEGES;
注意:上面有两处需要修改成你自己的:一个 是'someuser'@'%'改为你报错的括号里面的 ,还有一处是 'complex-password' 改成你的密码,就ok了。