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:
- 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)
- Restart the MySQL service.
- 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)
- Execute "use MySQL;", using MySQL database.
- Execute "Update user set Password=password (" 123456 ") where user= ' root '; (Change the root password)
- Open the My.ini file in the MySQL directory, delete the last line of "Skip-grant-tables", save and close the file.
- Restart the MySQL service.
- 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.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
MySQL problem solution: Access denied for user ' root ' @ ' localhost ' (using Password:yes)