共計 822 個字符,預計需要花費 3 分鐘才能閱讀完成。
行業資訊
數據庫
MySQL 出現 Access denied for user‘root’@ localhost’using password: YES 錯誤該怎么辦
MySQL 出現 Access denied for user‘root’@ localhost’using password: YES 錯誤該怎么辦
發布時間:2021-12-01 09:28:35
來源:丸趣 TV
閱讀:158
作者:柒染
欄目:數據庫
MySQL 出現 Access denied for user‘root’@ localhost’using password: YES 錯誤該怎么辦,很多新手對此不是很清楚,為了幫助大家解決這個難題,下面丸趣 TV 小編將為大家詳細講解,有這方面需求的人可以來學習下,希望你能有所收獲。
登錄某臺服務器的 mysql 時候總報錯:
mysql2/client.rb:58:in `connect : Access denied for user root @ localhost (using password: YES) (Mysql2::Error)
解決方法:
# /etc/init.d/mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking
# mysql -u root mysql
mysql UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql FLUSH PRIVILEGES;
mysql quit
# /etc/init.d/mysqld restart
# mysql -uroot -p
Enter password: 輸入新設的密碼 newpassword
mysql
看完上述內容是否對您有幫助呢?如果還想對相關知識有進一步的了解或閱讀更多相關文章,請關注丸趣 TV 行業資訊頻道,感謝您對丸趣 TV 的支持。
正文完