您的位置:首页 > 其它

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

2012-03-27 11:10 423 查看
原因分析
因为创建视图使用的是root@%用户(目前已经不存在),然后登录用户使用的是test@localhost用户,导致mysql认为现在的test用户无权限访问该视图,解决方法就是在当前用户下test 重建该视图。
如果你是运维人员,此问题直接交由程序去处理,让其检查创建触发器、视图、存储过程等sql。如果包含root@%,替换之。重新创建。

结合一下命令,可以看个大概。
select `name` from mysql.proc where db = 'xxxxxx' and `type` = 'PROCEDURE' limit 5\G
update mysql.event set definer='admin@%' where db='xxxxx‘;
show events\G
show procedure status;
update mysql.proc set definer='admin@%' where db = 'xxxxxxxx' and `type` = 'PROCEDURE';
select * from information_schema.VIEWS limit 4\G
show triggers\G
show function status\G本文出自 “John Steven - 咸鱼” 博客,请务必保留此出处http://johnsteven.blog.51cto.com/2523007/818300
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐