MySQL5.7登錄報1045解決方式


1045    Access denied for user 'root'@'localhost' (using password:YES)

這個意思是說:用戶“root”@本地主機的訪問被拒絕

 

1、首先修改my.ini,在文件中加入skip-grant-tables,重新啟動MySQL服務

 

 

2、cmd    輸入 mysql -u root -p  出現enter password直接回車

3、use mysql

 

 4、修改密碼: update mysql.user set authentication_string=password('root@123456') where user='root' and host='localhost";

 

 5、flush privileges;      //刷新數據庫

 6、注釋掉

skip-grant-tables

 7、重新啟動MySQL


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM