The MySQL service suddenly hangs up with the error message can’t connect to MySQL server on ‘localhost’ (10061)

ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)
ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)


>
> Services.msc (open service) –>; Find MySQL in the services list –>; Right-click MySQL and click Start
However, sometimes you have installed MySQL, but there is no MySQL in the service list. What can you do?

(1) Open CMD (run C:\Windows\System32\cmd.exe as an administrator),
(2) Use CD to change the directory to bin directory of MySQL Server 5.6;
C:\Program Files\MySQL\MySQL Server 5.6\bin> mysqld.exe -install
(4) When there is Service successfully installed, it means that MySQL Service successfully installed.
At this point, the MySQL service is already present in the computer service.
Matters needing attention
The CMD command opens and runs under the bin directory where MySQL is installed:
> > > Mysqld –install (“mysqld”, not “mysql”)

Install/Remove of the Service Denied
Install/Remove of the Service Denied

open CMD and run it as an administrator.
When: Service successfully installed. Indicates that the service is installed successfully.

Read More: