Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if the MySQ login prompt ERROR 1045 (28000) error

2025-05-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail about the MySQ login prompt ERROR 1045 (28000) error how to do, the editor thinks it is very practical, so share with you to do a reference, I hope you can get something after reading this article.

We often make mistakes when we log on to mysql. This article mainly introduces the solution to the error of MySQ login prompt ERROR 1045 (28000) in detail, which has a certain reference value. Interested friends can refer to it, hoping to help you.

Today, the login server is ready to modify something in the database. But enter the password, but can not enter the database and prompt an error, as shown in the following figure

If you confirm that the password is correct, you still can't get into the database. The solution was found on the Internet and recorded for reference and study.

Solution:

General idea: (under the Linux system) close the MySQL service, configure MySQL to log in without a password, then reset the password, refresh the database, remove the previous configuration, and restart MySQL.

1. Turn off the MySQL service, command: service mysqld stop. Find your MySQL configuration file, and each person may install it in a different location, such as my profile, as shown in the following figure

two。 In the directory where the configuration file is located, edit it with the vim command, command: vim my.cnf

To enter vim editing mode, press insert and add skip_grant_tables at the specified location in the following figure, as shown in the following figure

3. Then save and exit the configuration file, command: ① shift+ semicolon ②, enter wq ③ and press enter. In this way, you can configure login without a password. Start the database, command: service mysqld start. Enter the database, type: mysql-u root-p on the command line, and then press enter to enter the database O (∩ _ ∩) O

4. After entering the database, set a new password to the database, and if you still want to use the previous password, set it to the previous password, which is also possible.

Command (enter once after a command):

① use mysql

② update user set password=password (new password) where user= "root"

③ flush privileges

④ quit

Note: the second command is suitable for MySQL5.6 and earlier versions. Since there is no password field in MySql5.7, update user set authentication_string = password ('newpassword') where user='root'; should be executed to change the password.

5. After the database password is changed, comment out the modified part of the original database configuration file, and add a # number before the statement.

6. Restart the database service, command: service mysqld restart. At this point, you can log in to the database with the password you just set.

On the MySQ login prompt ERROR 1045 (28000) error how to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report