ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061) Solution

I want to start mysql, but the following problem occurs when I directly enter mysql -u root -p in cmd:

C:\Users\lic>mysql -u root -p
Enter password: *****
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)

Solution:
After running cmd as an administrator (win+Q, right-click after searching for cmd), enter net start mysql, the startup is successful, and then you can return to the cmd run by non-administrators for normal operations.
insert image description here
After MySQL is started, it can be used normally
insert image description here

Guess you like

Origin blog.csdn.net/lic1697067085/article/details/120234123