MySQL problem solution: Access denied for user ' root ' @ ' localhost ' (using Password:yes)

Source: Internet
Author: User

This two days when developing Web projects in MyEclipse, there was a problem connecting to the MySQL database:Access denied for user ' root ' @ ' localhost ' (using Password:yes).

Find information found that the root account is not open to remote access permissions by default, so you need to modify the permissions.

Solution:
    1. Open the My.ini file in the MySQL directory, add a line "Skip-grant-tables" at the end of the file, and save and close the file. (WIN7 default installation, My.ini in C:\ProgramData\MySQL\MySQL Server 5.6)
    2. Restart the MySQL service.
    3. Enter the MySQL bin directory via the command line, type "Mysql-u root-p" (without entering the password) and enter the database. (WIN7 default installation, Bin directory: C:\Program files\mysql\mysql Server 5.6\bin)
    4. Execute "use MySQL;", using MySQL database.
    5. Execute "Update user set Password=password (" 123456 ") where user= ' root '; (Change the root password)
    6. Open the My.ini file in the MySQL directory, delete the last line of "Skip-grant-tables", save and close the file.
    7. Restart the MySQL service.
    8. You can successfully connect to the database by entering "Mysql-u root-p 123456" on the command line.

By completing the above steps, MyEclipse can also successfully connect to MySQL.

MySQL problem solution: Access denied for user ' root ' @ ' localhost ' (using Password:yes)

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.