迁移过来的别人的数据库,在运行项目的时候,报错提示

admin可以是任何一个用户名,例如,你也有可能遇到:

The user specified as a definer ('root'@'%') does not exist 或者

The user specified as a definer ('user'@'%') does not exist 等等一些其他的,都可以用这个方法进行解决

问题:

出现了类似语句,问题就是登陆的该用户缺失对该数据库的一些操作权限。

解决办法:

首先,打开cmd窗口,然后输入:

mysql -hlocalhost -uroot -p密码   点击回车

接下来输入:

grant all privileges on *.* to root/admin/user/其他(错误提示哪一个就输入哪一个) @"%" identified by "密码";  分号结尾,点击回车

最后:

flush privileges;  分号结尾,点击回车

 

相关文章:

  • 2022-01-11
  • 2022-01-08
  • 2021-05-28
  • 2021-10-10
  • 2021-08-17
  • 2022-12-23
猜你喜欢
  • 2021-08-11
  • 2021-06-09
相关资源
相似解决方案