Navicat鏈接mysql出現1045錯誤

使用Navicat鏈接mysql出現1045,可能的緣由爲忘記密碼,mysql

 


 下面方法能夠幫助重置密碼sql

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

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

3,關閉mysqld進程,ui

>>tasklist |findstr mysqld        這行命令能夠用來查看mysqld是否在運行,在運行中則能夠查到它的PIDspa

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

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

>>mysqld --skip-grant-tables進程

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

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

 

 


 再次 鏈接測試,

大功告成!

相關文章
相關標籤/搜索