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

緣由分析
由於建立視圖使用的是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
相關文章
相關標籤/搜索