Access denied for user ' root ' @ ' localhost ' (using password:yes) solution

Source: Internet
Author: User

Want to enter the database, found that no entry, error access denied for user ' root ' @ ' localhost ' (using Password:yes)

Tried a lot of methods can not, and then solved the

Workaround:

1. Stop MySQL First

shell># Service mysqld Stop

2. The meaning of this code is probably the start
MySQL does not start grant-tables, authorization form

shell># mysqld_safe--user=mysql--skip-grant-tables--skip-networking &

3. Go to MySQL

Shell "# mysql-uroot MySQL

4. View the database, whether there is a MySQL database and select MySQL database

Mysql> Show databases

mysql> use MySQL

5. Delete user-empty data

mysql> Delete from user where user= ';

6. Reset Password

mysql> Update user set Password=password (' Password you want to set ') where user= ' root ';

7. Refresh Permissions

mysql> flush Privileges;

8. Exit

Mysql> exit;

9. Restart MySQL

shell># Service mysqld Restart

10. Test, get it done!

Access denied for user ' root ' @ ' localhost ' (using password:yes) solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.