登录某台服务器的mysql时候总报错:
mysql2/client.rb:58:in `connect': Access denied for user 'root'@'localhost' (using password: YES) (Mysql2::Error)
解决方法:
%20在windows%20下的解决方法也一样的
[sql] view%20plaincopy
- # /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:
- mysql>