MySQL 出現 Access denied for user amp;#x27;rootamp

分類:編程 時間:2016-11-03
網管之家bitsCN.com

登錄某臺服務器的mysql時候總報錯:

mysql2/client.rb:58:in `connect': Access denied for user 'root'@'localhost' (using password: YES) (Mysql2::Error)

解決方法:

  在Windows 下的解決方法也一樣的 

[sql]   view plain copy 在CODE上查看代碼片 派生到我的代碼片

  1. # /etc/init.d/mysqld stop   
  2. # mysqld_safe  --user=mysql --skip-grant-tables --skip-Networking &   
  3. # mysql -u root mysql   
  4. mysql>  update  user  SET  Password= PASSWORD(’newpassword’)  where  USER=’root’;   
  5. mysql> FLUSH  PRIVILEGES;   
  6. mysql> quit   
  7. # /etc/init.d/mysqld restart   
  8. # mysql -uroot -p   
  9. Enter  password: <輸入新設的密碼newpassword>   
  10. mysql>  
網管之家bitsCN.com
Tags: localhost password windows 服務器 Error

文章來源:


ads
ads

相關文章
ads

相關文章

ad