MySQL——视图查询报错ERROR 1045 (28000): Access denied for user 'test1'@'%' (using password: YES)
1.用户geek996创建视图test_view
1 | create view test_view as select * from account; |
2.用户test1查询视图正常
3.删除用户 geek996
1 | drop user geek996 |
4.用户test查询视图报错
总结
因为创建该视图的账号被删除,导致无法获取该视图的定义者出错
另一个错误View 'xxx' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
是因为创建该视图的账户降权导致
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Rick's Blog!
评论