[mysql] Can't connect to MySQL server on '127.0.0.1' (10061) (2003)

I know this question was asked a lot before but I tried some of the solutions which were given and nothing worked..

I have downloaded MySQL Workbench 6.1 on my windows 7 x64 and now as I want to start and do a simple DB I set a new MySQL Connection and let it as default the Hostname, port and the username I just set the name of the connection. In the beginning it was showing down in the action output that Could not connect.Server may not be run and in the msg part it was written Can't connect to MySQL server on '127.0.0.1' (10061) but I thought I would be able to do a DB and test it Then I created simple DB and when I wanted to execute it I couldn't press the Bolt which execute the DB so I tried from Query and I pressed the 2nd option which is "Execute(All or Selection) to text" as I couldn't choose any other option and this error was shown Can't connect to MySQL server on '127.0.0.1' (10061) (2003)

I am new in this I have used SQL*Plus for a while but it is not the same.

Thanks in advance.

This question is related to mysql database localhost mysql-workbench windows-7-x64

The answer is


In Windows goto task-manager >"services" and check that "MySQL" is runing. If not
Right click on it ->open services->MySQL-> startup type -> 'Automatic' -> apply and OK. this is for windows 10 MySql 5.7


I simply used mysql installer to reconfigure the server instance http://prntscr.com/wcl3p9


To re-iterate what Jens wrote in more current code, first open the Command Prompt with Administrator access by right-clicking the Command Prompt icon and select "Run as administrator." Then cut and paste the following into the Command Prompt at the C:> directory level:

"C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin\mysqld" --install 

You may have to change the name of the folder depending on where MySQL is installed and what version it is.


Resolved this issue by navigating to C:\xampp\mysql\bin and double clicking on mysqld.exe and then allow access in the pop up that comes. My server status on workbench changed to running


I solved the problem as follows:

  1. run MySQLInstanceConfig.exe

    C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin\MySQLInstanceConfig.exe

  2. Follow to the end without changing anything.


(Windows) If you have already installed MySQL server

cd C:\Program Files\MySQL\MySQL Server X.X\bin mysqld --install

and still cannot connect, then the service did not start automatically. Just try

Start > Search "services"

and scroll down until you see "MySQLXX", where the XX represents the MySQL Server version. If the Status isn't "Started", then

Right Click > Start

If you are here you should be golden: enter image description here


I know that there are a lot of answers to this question already already but i wanted to share my experience as none of the answers provided fixed this issue for me.

After about a day of exploring different solutions I believe the issue was that I have recently installed XAMPP and it was interfering with the MySQL workbench. I have tried changing the port numbers however this hasn't helped, and it seems that both programs are sharing configuration files. Repairing MySQL in the Control Panel didn't resolve it, so now I am uninstalling MySQL and plan to reinstall it. Another potential solution maybe to uninstall XAMPP however the config files may either be deleted, or left in the xampp folder instead of the MySQL folder by doing so.


Slightly different case, but it may help someone.

I followed the instructions to create a secondary database instance, and I had to clone the ini file as part of that. It was failing to start the service, with the same error. Turns out notepad.exe had re-encoded the cloned ini file as UTF8-BOM, and MySQL (version 8) refused to work with it. Removing the BOM fixed the problem.


In my case, I had installed a new installation of MYSQL(8) and WORKBENCH etc. so that I could then work on an old WordPress website. No matter what I did, it wouldn't work. Kept getting "ERROR ESTABLISHING CONNECTION" etc. Thinking that it was maybe something to do with WordPress(since it is old), I tried a basic manual connection with PHP and nothing.

Eventually, I figured out that I had to downgrade MySQL. So I went back to MYSQL installer, found the server, and downgraded MYSQL from 8.0 back to 5.5

As soon as I did that, everything worked.


I encountered a similar problem. I am using WinNMP. When I started it, MariaDB was also not running and prompts "Can't connect to MySQL server on '127.0.0.1' (10061) (2003)" whenever I try to connect to a database.

Just want to help. For WinNMP users like me, this worked for me:

  1. Run msyqld installer located at "C:\WinNMP\bin\MariaDB\bin".
  2. Restart your WinNMP.
  3. MariaDB should be running now.

Hope this helps someone! :D


Avoid using bind_address in your my.cnf file, if you have any.

Ref: http://dev.mysql.com/doc/refman/5.5/en/can-not-connect-to-server.html


I was facing the same problem, but what I did not realise is that I did not have the MySQL Server installed. You must simply install the MySQL Server.

In order to install the MySQL server, you must run the "MySql Installer" and then press the "Add" button and then choose the "MySQL Server" in the tree.

After doing that, run you workbench again and you'll notice that there'll already be a connection configured. Hopefully, you'll be able to create a new connection or as many connections as you want.


If you have already installed MySQL on a windows machine make sure it is running as a service.. You can do that by

Start --> services --> MySQL(ver) --> Right-Click --> Start


maybe it has a different solution, but I fixed it by finding mysqld.exe and running following command in the console:

C:\wamp\bin\mysql\mysql5.6.17\bin\mysqld.exe --console

You should be able to see following result:

enter image description here


If you have already created a localhost connection and its still showing can not connect then goto taskbar and find the MySQL notifier icon. Click on that and check whether your connection name is running or stopped. If its stopped then start or restart. I was facing the same issue but it fixed my problem.


In my case I had a previous mySQL server installation (with non-standard port), and I re-installed to a different directory & port. Then I got the same issue. To resolve, you click on home + add new connection.

If you need to know the port of your server, you can find it when you start My SQL command line client via All Programs -> MySQL -> MySQL ServerX.Y -> MySQL X.Y Command Line Client and run command status (as below)

how to create

how to find port


Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to database

Implement specialization in ER diagram phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' cannot be loaded Room - Schema export directory is not provided to the annotation processor so we cannot export the schema SQL Query Where Date = Today Minus 7 Days MySQL Error: : 'Access denied for user 'root'@'localhost' SQL Server date format yyyymmdd How to create a foreign key in phpmyadmin WooCommerce: Finding the products in database TypeError: tuple indices must be integers, not str

Examples related to localhost

Xampp localhost/dashboard Set cookies for cross origin requests Invalid Host Header when ngrok tries to connect to React dev server How to turn on/off MySQL strict mode in localhost (xampp)? What is IPV6 for localhost and 0.0.0.0? How do I kill the process currently using a port on localhost in Windows? How to run html file on localhost? Can't access 127.0.0.1 Server http:/localhost:8080 requires a user name and a password. The server says: XDB How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?

Examples related to mysql-workbench

Authentication plugin 'caching_sha2_password' cannot be loaded Cannot connect to MySQL Workbench on mac. Can't connect to MySQL server on '127.0.0.1' (61) Mac Macintosh MySQL Workbench not displaying query results Can't connect to MySQL server on '127.0.0.1' (10061) (2003) How to unblock with mysqladmin flush hosts How to create localhost database using mysql? MySQL Workbench - Connect to a Localhost MySQL Workbench not opening on Windows How to view table contents in Mysql Workbench GUI? Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?

Examples related to windows-7-x64

"The following SDK components were not installed: sys-img-x86-addon-google_apis-google-22 and addon-google_apis-google-22" The service cannot accept control messages at this time Creating self signed certificate for domain and subdomains - NET::ERR_CERT_COMMON_NAME_INVALID ImportError: No module named enum Git credential helper - update password Can't connect to MySQL server on '127.0.0.1' (10061) (2003) Register .NET Framework 4.5 in IIS 7.5 Windows 7 - Add Path How do I start Mongo DB from Windows? How to completely remove node.js from Windows