One, MySQL login error
Mysqladmin:connect to server at ' localhost ' failed
Error: ' Access denied for user ' root ' @ ' localhost ' (using Password:yes) '
Workaround: Hack the MySQL password
1> stop MySQL service: service mysqld Stop
2> Execute command:> mysqld_safe--skip-grant-tables & mysql-uroot-p Enter
> Use mysql;
> Update user set Password=password ("Newpass") where user= "root";
Change Password to newpass
> flush privileges; Update Permissions
> quit quitting
3> Restart MySQL services: Servicemysqld Restart
4> Link Database:mysql-uroot-p New Password
Second, forget the local root login password code
Resolution process:
1. Edit /etc/my.cnf
Add a row in the [mysqld] configuration section
Skip-grant-tables
2. Restart MySQL after saving
[Email protected] etc]# service mysqld restart
3. Log in to the database to reset the root password
[email protected] ~]# mysql-uroot-p MySQL
Enter Password:
Direct Carriage Enter
mysql>show databases;
Execute the following statement
mysql> Update user set Password=password ("MySQL") where user= ' root ';
mysql> flush Privileges;
4, Delete the "skip-grant-tables" line added in the/etc/my.cnf file, restart MySQL;
With the new password will be able to log in normally;
Original link: http://blog.sina.com.cn/s/blog_8442befd01015zld.html
MySQL Login issues