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?

王林
Release: 2022-01-12 15:43:15
Original
48309 people have browsed it

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";
Copy after login

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';
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template