MySQL ERROR 1045 (28000): Access denied for user resolves

Source: Internet
Author: User

Problem Recurrence (The following discussion is for Windows environments only):

C:\appserv\mysql> Mysql-u Root-p
Enter Password:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)

edit mysql config file my.ini (not sure where to search), in [MYSQLD] This entry is added under
   Skip-grant-tables
Save after exiting restart MySQL

1. Click "Start", "Run" (shortcut key Win+r).

2. Start: Enter net stop MySQL

3. Stop: Enter net start MySQL


At this time in the cmd input mysql-u root-p can be used without password login, appear password: when the direct return can enter, will not appear error 1045 (28000), but many operations will be limited, Because we can't grant (without permission). Follow the process below (the red part is the input section, the pink One is the code shown after the execution does not have to be entered):

1. Go to MySQL database:

mysql> use MySQL;

2. Set a new password to the root user, blue section enter it yourself:
mysql> Update user Set Password=password (" New Password ") where user=" root ";

3. Refreshing the database
mysql> flush Privileges;
query OK, 0 rows Affected (0.00 sec)

4. Exit MySQL:
Mysql> quit
Bye

After the change, and then modify the My.ini this file, we just joined the "Skip-grant-tables" this line to delete, save the exit and then restart MySQL.


MySQL ERROR 1045 (28000): Access denied for user resolves

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.