WINDOWS MYSQL Error Error 1045 (28000) Error 1054 (42S22) and Error 1820 (HY000) Solution

1. Question: Command prompt window, run instructions under MySQL installation bin directory:

X:*Location*binMySQL> Mysql-u root-p
(Everyone chooses different directories according to their own motivation.) appears:

Enter password:
An error occurred after entering or not entering a carriage return:

ERROR 1045 (28000): Access denied for user’root’@ localhost (using password: YES)

ERROR 1045 (28000): Access denied for’user’@’localhost (using password: NO)
Go to your root directory to configure your MySQL profile, my. Ini
If it’s still nice and the setup environment refer to:
MySQL-5.6.13 Install-Free Configuration Method

Notepad Open my. Ini, add

save and restart MySQL
restart method 1:
1 under this entry [mysqld]. Click Start – > “Run” (shortcut Win+R). 2. Start: Enter net stop MySQL
3. Stop: Enter net start MySQL
Restart method 2:
If 1 does not work, go to Computer Management-gt; Services and Applications -> Service -> MYSQL-gt; Right-click -> Start.
Enter mysql-u root-p into the CMD at this time to log in without a password. Enter directly when the password appears,
ERROR 1045 (28000) will not appear, and many operations without permission will be restricted.
The following (italics are the result of command prompts after operation, not entered):
1. Enter MySQL database:

mysql> Use mysql; Database changed
2. Set a new password for the root user, and type the new password yourself:

mysql> Update user set password=password (“new password”) where user=”root”; Warning: This command is older than 5.7. If you use a new one, you will encounter errors in the input:

ERROR 1054 (42S22): Unknown column’password’in’fie This is because the password field is no longer available in MySQL database under version 5.7 and the password field is changed to

authentication_authentication String
So you should enter the following command:

update mysql. User set authentication_ String=password (‘root’) where user=’root’; Query OK, 1 rows affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0
3. Refresh the database

mysql> Flush privileges; Query OK, 0 rows affected (0.00 sec)
4. Exit mysql:

mysql> Quit
5. After that, make a change to my. Ini This file, just added my. “Skip-grant-tables” line of INI file is deleted. Save exit and restart mysql. Restart method see above.
The blogger here thought it would be great, but it wasn’t.
entered mysql, the following error occurred:

ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
pitted a father.
Finally found that the password needs to be reset!!! (Isn’t the last thing I did all about how to eat shit?)
Solutions are as follows:

mysql> SET PASSWORD = PASSWORD (‘123456’); You’re not mistaken, it’s just setting one side of the password. Of course, you don’t have to make 123456. It’s arbitrary.

Related Posts