Home >Database >Mysql Tutorial >What should I do if a 1045 error is reported when connecting to mysql?
Solution to the 1045 error reported when connecting to mysql: 1. Open the my.ini configuration file; 2. Add [skip-grant-tables] and save the file; 3. Restart the mysql service; 4. Log in to mysql and modify it Password; 5. Log out and reconnect.
Solution:
(Recommended tutorial: mysql tutorial)
First open my. ini configuration file.
Then add skip-grant-tables under the mysqld field, save and exit.
If the save fails, please stop the mysql service and then save.
Finally restart the mysql service.
Now we can log in to the mysql database.
Re-change the password after logging in to the database.
update user set password=password("root22") where user="root";
If the error "ERROR 1054 (42S22): Unknown column 'password' in 'field list'" is reported, then execute this command
update user set authentication_string=password('root22') where user='root';
After completion, exit and reconnect.
Related recommendations: php training
The above is the detailed content of What should I do if a 1045 error is reported when connecting to mysql?. For more information, please follow other related articles on the PHP Chinese website!