Home >Database >Mysql Tutorial >What should I do if a 1045 error is reported when connecting to mysql?

What should I do if a 1045 error is reported when connecting to mysql?

王林
王林Original
2020-09-29 13:23:1148332browse

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.

What should I do if a 1045 error is reported when connecting to mysql?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn