MySQL ERROR 1045 (28000): Access denied for user workaround My-default.ini

Source: Internet
Author: User


Problem: password forgot input error case, login prompt:error 1045 (28000): Access denied for user

Check the online solution there is a My.ini file to add skip-grant-tables This paragraph of the text of the scheme. My version of mysql-5.6.24 is free to install. Folder only My-default.ini files, if directly in the My-default.ini file under the [mysqld] add skip-grant-tables is not effective.

You can rename the My-default.ini directly to My.ini, then add skip-grant-tablesunder [mysqld] and restart the MySQL service.

At this time, the root user can log in and change the operation through the command line.

c:\users\administrator>mysql-u root-p

Enter Password:

Enter directly, no password required


Change the root password operation, replace the new password with the password you need to set

mysql> use MySQL;

Database changed

mysql> Update user Set Password=password (" New password ") where user= "root";

Query OK, 3 Rows Affected (0.00 sec)

Rows Matched:3 Changed:3 warnings:0


mysql> flush Privileges;

Query OK, 0 rows affected (0.01 sec)


Finally, the My.ini added skip-grant-tables line is deleted, the file name is changed back to My-default.ini, restart the MySQL service.

MySQL ERROR 1045 (28000): Access denied for user workaround My-default.ini

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.