About MySQL Login error message: Error 1045 (28000) workaround

Source: Internet
Author: User
Tags mysql login

Login MySQL Database error message error 1045 (28000) is as follows:

[[email protected] ~]# mysql-uroot-p fanshineenter password:error 1045 (28000): Access denied for user ' root ' @ ' Localhos T ' (using Password:yes)

Analysis: The existence of a database empty user caused

Solve:

    1. Stop MySQL Service

[[Email protected] ~]# service mysqld stop

2. Enter MySQL security mode

[Email protected] ~]# mysqld_safe--user=mysql--skip-grant-tables--skip-networking &

Note:--skip-grant-tables start MySQL does not start grant-tables, authorization table;--skip-networking turn off MySQL TCP/IP connection, skip network

3. Log in to the MySQL database

[[email protected] ~]# mysql-u root MySQL

4.

mysql> use MySQL;

5. Enquiry

Mysql> select User,host,password from user;

The results are as follows:

+------+-----------+-------------------------------------------+| user | Host |    Password |+------+-----------+-------------------------------------------+| | localhost | Root | localhost | *19a893fc29dbd6e2c8eaf9e248ea22aa1e1a24b7 | | Root | 127.0.0.1 | *19a893fc29dbd6e2c8eaf9e248ea22aa1e1a24b7 |+------+-----------+-------------------------------------------+

6. Delete Empty users

mysql> Delete from user where user= ';

7. Exit

Mysql> quit

8. Start the service

[[Email protected] ~]# service mysqld start

9. Re-Login

[Email protected] ~]# mysql-u root-penter Password:
Enter the password to log in.


About MySQL Login error message: Error 1045 (28000) workaround

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.