1. 程式人生 > 實用技巧 >1356 - View "information schema.SCHEMATA' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack

1356 - View "information schema.SCHEMATA' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack

Navicat 連結mysql 資料庫報錯,

使用mysql終端登陸 show 命令也報錯

ERROR 1356 (HY000): View 'information_schema.COLUMNS' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

ERROR 1356 (HY000): View 'information_schema.SCHEMATA' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

報錯資訊是沒有許可權,隱約記得改過mysql.user 表的mysql.infoschema許可權資訊,改的哪個忘了,導致關機重新開機後報上述錯誤,information_schema庫下面的所有檢視不能訪問

不知道mysql.infoschema的哪個許可權跟information_schema的查詢有關,以為是Show_view_priv,Show_db_priv,Process_priv影響的但是改完後仍報錯,最後嘗試修改Select_priv 能正常訪問了

執行語句

use mysql;
select * from user where User ='mysql.infoschema';
update user set Select_priv = 'Y' where User = 'mysql.infoschema';
flush privileges;