Home >Database >Mysql Tutorial >MySQL 出现 Access denied for user 'root&amp_MySQL

MySQL 出现 Access denied for user 'root&amp_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-31 08:46:421263browse

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:    
  10. mysql>  
bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn