When you re-pick up the MySQL database, the first time you connect to the database, you get access denied for user ' root ' @ ' localhost ' (using Password:yes) error. Check the relevant information, found that the root account is not open by default remote access permissions, so need to modify the relevant permissions. You can do the following workaround.
-
- 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.
- 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.
- Execute "use MySQL;", using MySQL database.
- Execute "Update user set Password=password (" 123456 ") where user= ' root ';
- 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.
An error occurred connecting to the MySQL database: Access denied for user ' root ' @ ' localhost ' (using Password:yes)