Bug #61163 Can't connect to a running MySQL Server with other programs.
Submitted: 13 May 2011 9:20 Modified: 24 Feb 2012 10:27
Reporter: Simon Höddels Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: Errors Severity:S2 (Serious)
Version:5.5.x OS:Microsoft Windows (SP3 and all recent updates installed.)
Assigned to: CPU Architecture:Any
Tags: connection problem

[13 May 2011 9:20] Simon Höddels
I'm using Windows XP SP3 with all the latest updates installed.
Up until yesterday I could connect to a local MySQL-Server without any problems. Starting yesterday I can't anymore. I always get the error message "SQL Error (200): Can't connect to mysql server on '' (10061)".
I've installed MySQL as a service on Port 3306. The firewall and anti-virus program disabled. The process mysqld.exe is running.
Now, the peculiar thing is: With mysql.exe or mysqladmin.exe I can connect just fine. I can do queries and other stuff. But when I use an extern tool (MySQL Workbench, HeidiSQL, own programs, whatever...) I get the connection error. Earlier versions of MySQL are running fine (5.1.x). Newer (5.5.12 or 5.6) show the same problem. Therefore I guess it's a bug of MySQL, or am I wrong?
Also, if I connect to servers on remote machines, everything works fine.

How to repeat:
Install a MySQL server and start it in any way. Try to connect and get the error message.
Windows XP all Updates installed.
[13 May 2011 14:04] MySQL Verification Team
Could you please edit or create the windows\hosts file with: localhost

and try again.
[13 May 2011 15:17] Simon Höddels
I've already done that. It works with neither of it.
[18 May 2011 13:03] MySQL Verification Team
Verify if the user which can't connect with those clients application has localhost host privilege.
[18 May 2011 13:06] Simon Höddels
Yes, they have the privileges they need (in example localhost has host privilege).
[21 Jun 2011 23:02] MySQL Verification Team
Please try with version 5.5.13. Thanks.
[13 Jul 2011 8:54] Simon Höddels
I can't try it with 5.5.13 or 5.5.14 currently. I can try an update, but the community installer can't install because a newer version is installed (I've also installed 5.6). The different installs are just for test purposes and don't run at the same time. I switch between different versions to test functionality of my programs and to see if problems occur with older or newer versions of MySQL.
[15 Jul 2011 23:59] Vladislav Vaintroub
What are other tools you're trying to connect with?

Can you run 

netstat -ano |findstr 3306

(I'm particularly interested in checking if MySQL is listening on just IPv6 traffic, my theory is that it could break older IPv4 clients)
[18 Jul 2011 6:59] Simon Höddels
It looks like your guess is correct.
This is the result I get from netstat:
path>netstat -ano |findstr 3306
  TCP    [::]:3306              [::]:0                 ABHÖREN         2612

So there are no IPv4 ports.

I'm using tools like HeidiSQL and selfwritten software. Also I tried MySql Workbench and DreamCoder. Nothing except the mysql.exe command line tool works.
[18 Jul 2011 12:45] Vladislav Vaintroub
you can workaround this by adding 
to the [mysqld] section of my.ini

As for MySQL server fix, I think server it should check for Windows version(GetVersionEx() or something) and, by default, bind server socket to IPv4-any-address in XP, as IPv6 in XP is lacking dual stack support.
[18 Jul 2011 13:11] Simon Höddels
Thanks Vladislav!

You've helped me a great deal. The workaround with bind-address has worked.
I guess it would be nice if the server would prefer IPv4 over IPv6 on WindowsXP as you've mentioned it.
[18 Dec 2011 15:40] Valeriy Kravchuk
Bug #61725 was marked as a duplicate of this one.
[24 Feb 2012 10:27] Georgi Kodinov
Duplicate of bug #61713