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

Source: Internet
Author: User

Recently in the last interface Test training course, need to use MySQL, downloaded from the official website x64 Compression package version, after the decompression according to Baidu experience in the instructions, step-by-step use, started normal, but encountered an error in the login.

D:\Program files\mysql> mysql-u root-1045 (28000for'root '@'localhost' (using Password:yes)

Workaround:

Edit the MySQL profile My.ini (usually in the MySQL directory, do not know where to search), under the [mysqld] this entry to add

Skip-grant-tables

Restart MySQL after saving exit

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 not grant (no permission).
1. Go to MySQL database:

mysql> use MySQL;

2. Set a new password for the root user, and enter the blue part yourself:

mysql> Update user Set Password=password (" new password ") where user="root  "1 rows affected (0.01110

3. Refreshing the database

mysql>0 rows affected (0.00 sec)

4. Exit MySQL:

mysql> Quitbye


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 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.