When connecting to MySQL, error ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

I haven't used MySQL for a long time. I wanted to connect today, but suddenly found an error: ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061).

as the picture shows:

After determining whether it was a password problem, I searched and translated it: Error 2003 (HY000): Unable to connect to MySQL Server on "Localhost" (10061).

I read several methods on the Internet, and there are many operations, but none of them work. I was finally inspired by this article: https://www.jb51.net/article/216538.htm icon-default.png?t=M4ADhttps://www.jb51.net/article /216538.htm

 Thinking about it, my service mysqld.exe does not seem to be enabled, so I cannot connect to the local service. After running the software, I successfully log in:

 Of course, you can follow the steps in the above article to open step by step:

1. Right-click My Computer (if your computer does not have this icon, you can right-click to start)

2. Click "Management" in the right-click menu. Note: Win11 needs to click "Show More Options" first (find the computer management properties, this step corresponds to the content in the above brackets)

3. Select "Services and Applications" in the opened page, then find "Services", pull down to find the mysqld service, and right click to start it. (At this time, when the program is full screen, it is more convenient to find)

Guess you like

Origin blog.csdn.net/m0_54066656/article/details/125191546