创建视图报错: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)
文章讲述了在数据库迁移过程中遇到的视图权限问题,具体表现为1449错误,指定了不存在的定义用户。解决方案是通过GRANTALLPRIVILEGES授权给root@%所有权限,并使用FLUSHPRIVILEGES使更改生效。
5019

被折叠的 条评论
为什么被折叠?



