Connection error after installing MySQL (Error: Access denied for user ' root ' @ ' localhost ' (using password:yes) workaround

Source: Internet
Author: User
Tags mysql command line

A few days ago downloaded mysql5.7 Normal installation, with Navicat for MySQL connection when prompted "Access denied for user ' root ' @ ' localhost ' (using Password:yes)" "Error message, Because the first time the installation did not add the user, so uninstall and re-add the user and password installed after the open still error, draw on some of the online methods, and then use their own method to achieve the connection.

Workaround:

1. Open MySQL Command line Client, enter the password set when installing MySQL, the following interface appears;

2. Enter "use MySQL;" After the return, for the application of MySQL, the following interface appears;

3. Enter "select User,host from User;" Returns the user information that is used to query the database. The following interface appears;

4. Enter "select User,host,password from User;" After the return, used to query whether the user has set a password, if you can find out then skip to step 6, if not find out then continue to execute (I did not find out at that time, then add the password column, and then execute the change password);

5. Enter "ALTER TABLE user add column password varchar (64);" After carriage return, used to add the password column.

6. Enter "Update user set Password=password (' 123 ');" After the return, used to change the password to 123, the following interface appears;

This solves the problem.

Connection error after installing MySQL (Error: Access denied for user ' root ' @ ' localhost ' (using password:yes) workaround

Related Article

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.