Home > Database > Mysql Tutorial > body text

MySQL 出现 Access denied for user 'root'@&am_MySQL

WBOY
Release: 2016-05-31 08:46:50
Original
1030 people have browsed it

登录某台服务器的mysql时候总报错:

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

MySQL 出现 Access denied for user 'root'@&am_MySQL

解决方法:

 %20在windows%20下的解决方法也一样的 

 

[sql] view%20plaincopy在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>  
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template