Navicat連接mysql出現1045錯誤


使用Navicat連接mysql出現1045,可能的原因為忘記密碼,

 


 下面方法可以幫助重置密碼

1,以管理員權限運行cmd程序;

2,cd C:\Program Files (x86)\MySQL\MySQL Server 5.7\bin

3,關閉mysqld進程,

>>tasklist |findstr mysqld        這行命令可以用來查看mysqld是否在運行,在運行中則可以查到它的PID

>>taskkill /F /PID xxxx             xxxx是從前面一條命令得到的PID值

4,跳過權限登錄MySQL 服務器端

>>mysqld --skip-grant-tables

關閉cmd,重新以管理員權限運行cmd

5,修改密碼

>>cd C:\Program Files (x86)\MySQL\MySQL Server 5.7\bin

>>mysql

 

>>update mysql.user set authentication_string=password('123456') where user = 'root'; 

>>flush privileges;

   
>>SELECT * from mysql.user\G;
找到root用戶的authentication_string這項,並把它的值記下來

>>update mysql.user set authentication_string = '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' where user = 'root';here user = 'root';

>>flush privileges;
>>quit

6,重啟mysql

>>net start mysql

7,嘗試連接,如果提示1862

修改密碼后再次連接

>>mysqladmin -uroot -p password

 

 


 再次 連接測試,

大功告成!

 

引用:

huihuang88515

https://www.cnblogs.com/garrett/p/10677417.html


免責聲明!

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



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