场景:今天需要将远程服务器上面的MySQL数据库中的视图迁移到本地数据库中,结果执行视图SQL脚本抛出“[Err] 1449 - The user specified as a definer ('root'@'%') does not exist”错误信息。
解析:权限问题,需授权给 root 用户所有 sql 权限。执行如下sql即可(其中的root对应的是自己当前所用账号的用户名):
grant all privileges on *.* to root@"%" identified by ".";如下图:
![MySQL [Err] 1449 - The user specified as a definer ('root'@'%') does not exist 错误信息](https://www.hxstrive.com/hxstrivedocs/2020/02/03/f30275609e33440da3d7da2e07113b41.jpg)