HomeMySQL

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

Like Tweet Pin it Share Share Email
 

I have installed MySQL version 5.6 on windows 7. My Installation was successful and without any error. I received “ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)” while I was trying to start MySQL server from command prompt. I am attaching the screenshot of the error I received.

Image of command prompt while starting MySQL Server
Starting MySQL From Command Prompt

When I could not connect to MySQL server installed on my windows. I tried to connect MySQL Server directly by using “MySQL5.6 Command Line Client”. Same error was occurring and MySQL Command line was disappearing.

I was little worried of this error – ERROR 2003 (HY000). I did not get any of issues while installing MySQL5.6 on windows so MySQL server should work properly.
I did search on internet (MySQL forum, DB related forums) and I resolved Can’t connect to MySQL server on ‘localhost’ (10061) error. Now I was able to run MySQL server from command prompt.

Reason for ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061) – MySQL services has not been started.

Please see the steps below to fix this problem.

1. Please Log in as Admin to your System.
2. Open your Task Manager panel.
3. Go to Services tab.
4. See there for MySQL presence. It will look like this image given below.In my case it is displayed like MySQL56.

Image Showing Services tab in Task Manager
Showing MySQL Services Status using Task Manager
 
 

In the above image you can see that MySQL56 service is showing as Stopped. Please see the blue dark line in the image.

5. Please select MySQL56 and do right click. You will get Start option. Select Start command to start MySQL Services. Please see the below image for your reference.

Image displaying how to start mysql server from task manager services tab
Image Showing how to start MySQL server from task manager

6. Please recheck that MySQL service has been started successfully.
7. In case MySQL services do not start using this way, It means you are not logged in with Admin account. In this case you will receive this error.

Access is not possible
Getting Error if not logged in as Admin

Please follow next given steps to start MySQL service from Administrative Panel.
8. Please Go to  Control Panel > All Control Panel Items > Administrative Tools.
9. Please go to Services. Below image is showing the process.

Showing Administrative tools
Image showing Services in Administrative Tools

10. Please select MySQL56 under Name column.
11. Please click on start link from left panel to start MySQL Service. Please see the image below for your reference.

Image showing how to install mysql server manually from services
Starting MySQL server from Administrative panel

12. Once MySQL service started. Please go to MySQL bin directory using command prompt and retype the command >mysql -u root -p mysql
13. Please enter your MySQL password.
14. We can see image given below after MySQL server started successfully.

Command prompt showing mysql server started successfully
MySQL Server Started Successfully from Command prompt

Thanks for reading this post. Please let me know if your problem has been resolved.

Finally, In case you want to learn how to install MySQL server from scratch please check this YouTube video. Please do not forget to subscribe to our Youtube channel.

Comments (26)

  • thankyou very much for your visual feedback

    Reply
  • Thank you Tarun. An excellent explanation of how to solve the problem.

    Reply
  • Was working on this problem for 1 hour (at least !) when I fall on your explanation. Now it works like magic. Thanks a lot !

    Reply
  • Hi ,
    I am unable to start sql service.There is no service for myssql.
    tell me solution.

    Reply
    • Thanks Dinesh for writing your problem. It seems MySql has not been installed on your system completely. Once it is installed on your system it would be shown in services. Please go to Control Panel and Uninstall it. Unistall all the dependencies and all the folders from you System. After doing all these again install it. It should work fine. I would recommend you to run .msi file.

      Reply
  • Thank You Sir
    It really solved the issue 🙂

    Reply
  • Thank you sir……….:) your explanation have solved my problem..

    Reply
  • In the services, when i click in start link for mysql the following error is diplayed “windows could not start the windows search service on local computer error 2”

    Reply
    • Hi Dinesh, Many developer face this kind of problem. Please check 1. Are you trying to install right version compatible with your operating system. 2. Please check your firewall settings.
      Please let me know your windows configuration. I will send you link for installation.

      Reply
  • In the services, when i click in start link for mysql the following error is diplayed “windows could not start the MySql service on local computer. Error 2”

    Reply
  • Thanks tarun. It really solved my problem. Great solution

    Reply
  • I’ve done everything youve mentioned. Unfortunately, I’m still getting the same error message.

    Reply
  • Hello. My problem is the same as Dinesh. No service file even though Mysql is installed on my system. Need help.

    Thanks

    Nick

    Reply
    • Hello Nick! In case MySql was earlier installed on your system, please delete your temp files and data files related to MySql. Again re-install MySql. Go to services and check if MySql services are running. Please let me know for further doubts.

      Reply
  • Now also shows unexpected error on Window 10 please give a solution,.

    Reply
  • Hi Tarun,

    I installed MySql 5.6 on the window machine it installed successfully but when i open MySql from the Window in Mysql command prompt it just open & close again (blinking) very quickly. i have tried as you say above but it does not resolved.

    Please suggest if there is another way to do…..

    Reply
  • Thanks! Very helpful

    Reply
  • Hi,

    I installled mysql I thought successfully, but when I try to open the command line client for i, it opens for a split second then closes, as with other people on this thread.

    When going to Task Manager > Services tab and trying to start Mysql, I get the error with “Access denied”. So I followed up with your advice to go to Control Panel/Admin Tools and try to start Mysql there. I get the following error window!

    Services (on title bar)
    “The mysql service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.”

    OK button bottom right.

    Sorry I could not paste the error window here!

    I wonder what the solution would be now.

    Thanks in advance,
    Mukesh

    Reply
  • Very Helpful! I didn’t see it initially in my task manager but once I went to Services as you saud and started it, everything was working great then

    Reply
  • Thank you very much nice and clean.

    Reply
  • Thank you very much!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *