Problem description
After installing the MySQL5.5 database, use the Navicat Premium and the command window to connect to the database to report the following error:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Solutions
Usually this error is caused by forgetting the password, so we need to change the password, the following steps:
1. Open D:\Program files\mysql\mysql Server 5.5\my.ini and add a line of startup parameters under [Mysqld]
Skip-grant-tables
The purpose of this parameter is to skip the authorization table when the database is started, and no password verification is required.
2. Restart the MySQL server
3, re-login to the database, execute the following command to modify the password
Update user set Password=password (' root ') where user= ' root ';
4. Then refresh the system permissions related tables or restart the database for the new settings to take effect.
Flush privileges;
MySQL5.5 Error 1045 (28000): Solution to the problem of Access denied for user ' root ' @ ' localhost ' (using Password:yes)