在Windows系統(tǒng)中,mysql登錄的時候出現(xiàn)了這樣的錯誤:ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
從網(wǎng)上找了一些辦法,終于得到了解決,現(xiàn)在記錄一下具體的解決方法:
復制代碼代碼如下:
c:\>sc stop mysql
c:\>mysqld --defaults-file="C:\MySQL\MySQLServer6.0\my.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