Can't connect to MySQL server on 'localhost' (10061) after Installation Can't connect to MySQL server on 'localhost' (10061) after Installation windows windows

Can't connect to MySQL server on 'localhost' (10061) after Installation


Please Try the following steps:

  1. c:\mysql\bin>mysqld --install
  2. c:\mysql\bin>mysqld --initialize

then press "Windows key + R" write "services.msc", run as admin

start MySQL service.


I also faced the same issue and resolved it by below setups:

  1. Check the MYSQL service in the windows service. If it is there and not running then start it. It will solve your problem.

    You can find the services window by navigating to windows Start menu and typing 'services' in the search bar. Select the 'Services' option with the cogs next to it (not the executable file) and the below window will appear. Scroll down to find 'MySql (version)'. When you select MySql you should see an option in the left pane that says 'Start the service'. Click this and a dialogue should appear to indicate Windows is attempting to start the service. Once started the left pane will now give you the option to stop, pause and restart the service and you will now be able to connect to your MySql from the windows cmd line.

enter image description here

  1. If MYSQL service is not present in windows service then follow below setups.

    a. Open cmd as administrator.

    b. cd to C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin

    c. Run the command: C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysqld.exe --install

    d. Check the MySql in the windows service, And if it is not running, Start it by clicking on the service.

    e. If your using XAMMP . Start MySQL at the XAMMP control Panel.



this issue is very to solve by windows server users

  1. go to this pathC:\Program Files\MySQL\MySQL Server 5.1\bin

  2. run this tool "MySQLInstanceConfig.exe"

and config the instatnce again and problem solved