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

The user specified as a definer ('root'@'%') does not exist 此種報錯主要是針對訪問視圖文件引發的(沒有權限)mysql

按照下圖進行操做,sql

1.先看下mysql是否設置了環境變量,若是沒設置,就須要切換到mysql的bin目錄下執行命令(個人已經設置過了)ide

mysql -hlocalhost -uroot -p123456

2.給root用戶添加權限spa

grant all privileges on *.* to root@"%" identified by ".";

3.刷新權限code

flush privileges;
相關文章
相關標籤/搜索