[MySQL] Error: ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (10061) problem solving

I haven't used MySQL for a long time, and I am a little confused when I get an error. It is necessary to familiarize myself with MySQL login and use again to deepen my impression.

 

First, make sure that the local MySQL installation is successful, if not, move to the MySQL installation to continue the installation until it succeeds;

Secondly, MySQL can only be used under the identity of the cms administrator;

Let me talk about how to enter cmd as an administrator?

It's simple. Enter cmd in the search box in the lower left corner of win10, the following figure appears, select Run as administrator.

Then, enter the connection login command;

If you are still not sure about this common command, move to: https://blog.csdn.net/weixin_44566432/article/details/106008844 

 

 Next, my question today appeared:

The login connection fails, and an error message shows that the MySQL server cannot be connected.

So a series of inspection operations are performed below.

First confirm whether the MySQL service is started successfully: net start mysql  

If it is not started and MySQL cannot start the service , use mysqld --install to install in cmd.  After the installation is successful, continue to execute the start MySQL command  net start mysql.  If MySQL starts successfully, you can basically connect.

Connect to MySQL again, login is successful!

 

in conclusion:

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (10061) Problem solving:

Install in cmd : mysqld --install, then start MySQL: net start mysql 

Guess you like

Origin blog.csdn.net/weixin_44566432/article/details/108748036