创建视图报错:1449-the user specified as a definer(ywsd'0"%" does not exist

从一个数据库数据迁移到本地localhost

程序在调用到数据库的视图时报错,直接在数据库中打开视图时也报错,类似:

mysql 1449 : The user specified as a definer (‘root’@‘%’) does not exist

经查询是权限问题,解决办法:

运行sql:

1、grant all privileges on *.* to 'root'@'%' identified by ".";
 
2、flush privileges;

即可解决!

源地址的解释:

权限问题,授权 给 root 所有sql 权限

1、mysql> grant all privileges on *.* to root@"%" identified by ".";
 
2、Query OK, 0 rows affected (0.00 sec)
 
 
3、mysql> flush privileges;
 
4、Query OK, 0 rows affected (0.00 sec)
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐