遷移過來的別人的數據庫,在運行項目的時候,報錯提示
The user specified as a definer ('admin'@'%') does not exist
admin可以是任何一個用戶名,例如,你也有可能遇到:
The user specified as a definer ('root'@'%') does not exist 或者
The user specified as a definer ('user'@'%') does not exist 等等一些其他的,都可以用這個方法進行解決
問題:
出現了類似語句,問題就是登陸的該用戶缺失對該數據庫的一些操作權限。
解決辦法:
首先,打開cmd窗口,然后輸入:
mysql -hlocalhost -uroot -p密碼 點擊回車
接下來輸入:
grant all privileges on *.* to root/admin/user/其他(錯誤提示哪一個就輸入哪一個) @"%" identified by "密碼"; 分號結尾,點擊回車
最后:
flush privileges; 分號結尾,點擊回車