mysql登錄遇到ERROR 1045問題解決方法

mysql登錄時出現了錯誤:ERROR 1045: Access denied for user,究竟是什么原因呢?接下來為你詳細介紹下,感興趣的你可以參考下哈,或許可以幫助到你

在Windows系統中,mysql登錄的時候出現了這樣的錯誤:ERROR 1045: Access denied for user: ‘root@localhost’ (Using password: YES)

從網上找了一些辦法,終于得到了解決,現在記錄一下具體的解決方法:
代碼如下:
c:>sc stop mysql
c:>mysqld –defaults-file=”C:MySQLMySQLServer6.0my.ini” –console –skip-grant-tables

重新開一個cmd
代碼如下:
c:>mysql -uroot -p
enter password: mysql>UPDATE user SET Password=PASSWORD(‘newpassword’) where USER=’root’;
mysql>FLUSH PRIVILEGES;
mysql>quit

? 版權聲明
THE END
喜歡就支持一下吧
點贊11 分享