首頁  >  文章  >  資料庫  >  MySQL連線時出現1449與1045異常解決方法詳解

MySQL連線時出現1449與1045異常解決方法詳解

黄舟
黄舟原創
2017-09-06 14:47:121221瀏覽

這篇文章主要介紹了連接MySQL時出現1449與1045異常解決辦法的相關資料,透過IP連結MySQL的時候會出現1499與1054錯誤異常的情況,這裡提供解決辦法,需要的朋友可以參考下

連接MySQL時出現1449與1045異常解決辦法

mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法

把sql導到本地,執行預存程序或查看視訊報錯:

mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法

權限問題,授權給root  所有sql 權限 

mysql> grant all privileges on *.* to root@"%" identified by ".";
 
SQLException: The user specified as a definer ('ebook'@'%') does not exist:解决办法
grant all privileges on *.* to ebook@"%" identified by ".";
Query OK, 0 rows affected (0.00 sec)


mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
#Mysql

 連接時出現1045例外: 

如果是mysql 5.6以前的,輸入

UPDATE mysql.user SET Password=PASSWORD('123456') WHERE User='root';

如果是mysql 5.6以後的,輸入

UPDATE mysql.user SET authentication_string=PASSWORD('root') WHERE USER='root';

這是由於5.6以後user表中沒有password欄位。

輸入FLUSH PRIVILEGES; 刷新資料庫。

以上是MySQL連線時出現1449與1045異常解決方法詳解的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn