[mysql] MySQL Workbench: "Can't connect to MySQL server on 127.0.0.1' (10061)" error

I apologise.. I know this question has been asked many times before, but I've tried lots of suggestions, and simply can't find a solution.

The problem: I have a MySQL database running on a hosted server. I have to use SSH to connect to it, and I have the relevant Public and Private Key files.

I specifically want to use the PC version of MySQL Workbench, to access this database, for running queries, checking data, etc.

If I run Sequel Pro on a Mac, it connects fine, and I can browse and query the database. No problems.

If I run the trial version of SQLyog on a PC, it also connects fine. No problems.

But if I try to connect use MySQL's own "MySQL Workbench" application, using exactly the same settings and SSH Private Key file, it refuses to connect, throwing the well-known error:

Can't connect to MySQL server on 127.0.0.1' (10061)

I find it frustrating, as, in SQL Workbench, I specified the "MySQL Hostname" to use, db01.mysql.vm.MyHostingServer.net, but Workbench seems to ignore it, and demand to connect to 127.0.0.1 instead.

(I have read that Workbench says it needs the Public key file, but actually means the Private key file... and I have tried with both. I've also tried with MySQL Workbench on a Mac, but that crashed all over the place, simply when I was typing in server names and passwords.. it was a mess !!)

The hosting service I've gone with gives me limited permissions for changing MySQL settings, and given that Sequel Pro and SQLyog can connect successfully, I don't want to start messing about and changing things randomly.

Any ideas...?

This question is related to mysql mysql-workbench

The answer is


Even I had same problem, The reason was mysql service was not getting configured properly, when I installed it through 'MySQL installer'. Also it was not starting, when I tried to start the service manually.

So in my case it seemed be a Bug with the 'MySQL Installer', as editing the install path to a different one when the 'Developer default' was selected, the problem occurs.

Solution (Not exactly a solution):

  • Uninstalled the MySQL all products (completely)
  • Reinstalled, this time also I have selected 'Developer default', but didn't make any changes to the path or any thing. So the path was just 'C:\Program Files\MySQL' (the default one)
  • And just clicked Next Next...
  • Done, this time MySql was running fine.

I was having same issue, way i have resolved is:

opened the MySQL installer. i was having a Reconfigure link on MYSQL Server row. MYSQL Server having Reconfigure Link

Clicked on it, it does reinstalled MySQL Server. after that opened MySQL Workbench, and it was working fine.


After making above improvement such as checking if mysql service is running or not, you just need to give a small password while creating connection, it is ' ' or 1 time press on space-bar in case of GUI or workbench. After which you just need to validate your machine with server (validated HOST). For that purpose click on 'New Server Instance' and it will configure server/HOST on your behalf itself.

I have done this successfully just a few couple of minutes ago. My workbench software is able to show all pre-installed databases etc now.

hope it will work for you as well.

Thanks!!!


I have tried all the method. I will suggest you to reinstall it.


Ran into the exact same problem as OP and found that leaving the "MySQL Server Port" empty in the MySQL Workbench connection solves the issue.


Try placing the host name (db01.mysql.vm.MyHostingServer.net) in your windows host (C:\windows\system32\drivers\etc\host) file along with it's IP address and port number and see if that helps.


Maybe you are not allowed to start the service "MySQL 55". Set the login information of Service "MySQL 55" as local!

enter image description here

To see the list of aviable services in Windows 7:

  1. Open a run box enter image description here
  2. Type services.msc and press return.
  3. Find the service MySQL55
  4. A right click of the MySQL55 Local Service shows Properties -> Log On enter image description hereenter image description here

To connect to a new server, you click on home + add new connection. Put IP or webserver URL in new connection.

how to create


If you have installed WAMP on your machine, please make sure that it is running. Do not EXIT the WAMP from tray menu since it will stop the MySQL Server.


Just try to run the following command manually:

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

It worked for me :)