Start MYSQL error
I searched a lot on the Internet, saying that it was to configure a certain file or delete a certain file. The following pro test is valid, PS: MYSQL installation tutorial
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
It means that the password was entered, but an error was reported.
Solution:
re-enter:
mysql -u root -p
Now let you enter the password:
Enter password:
Press Enter directly at this time, do not enter the password! ! !
Press Enter directly at this time, do not enter the password! ! !
Press Enter directly at this time, do not enter the password! ! !
Say the important thing three times!
You will find that MYSQL is successfully started: (It's so weird...)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.22 MySQL Community Server - GPL
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
If you want to enter the password to start, you need to reset the password:
Input: mysql> ALTER user'root'@'localhost' IDENTIFIED BY '123456';
set the password to 123456. ( I still don’t know why I can enter without a password, and I need to reset my password. But it works)
mysql> ALTER user 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.07 sec) # 这句话表示修改成功
Start MYSQL again
mysql> exit #先输入exit,退出mysql
C:\Windows\system32>mysql -u root -p # 再次启动
Enter password: ****** # 输入密码123456
# 成功...
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.22 MySQL Community Server - GPL....
Change a start method
Input: net start mysql80
C:\Windows\system32>net start mysql80
MySQL80 服务正在启动 ..
MySQL80 服务已经启动成功。