We have a VB.Net application which works fine in our tests in different Windows XP SP3 machines. However there is one machine in which is displaying this error:
Unable to connect to any of the specified MySQL hosts
Using the mysql command, we can successfully connect to the database. We already checked for any other application or firewall that could be blocking the connection but it seems fine. We also reinstalled the system (no errors during the installation) but the MySQL error message doesn’t change.
The system settings are exactly the same as in the other computers. We are using “localhost” as server in the connection string. The “hosts” file has its default values (nothing strange in there).
Does anyone have a similar experience and can point me in the right direction?
It took me more than an hour to figure it out… I was trying to see if there was something wrong in the network configuration. So I issue:
And it gave me some clues: Comparing it with the other computers (that work fine), I found a difference:
NOT WORKING:
WORKING:
So, what is “[::]” and why is that zero to the right?
ANSWER:
I found out that “[::]” means 127.0.0.1 in IPv6 (about the zero, I have no idea).
So I checked the TCP/IP settings in the computer that was not working and “TCP/IP IPv6” was installed (which the working ones didn’t have). I uninstalled it, restarted and voila! It worked! 🙂
Perhaps some network card installers add IPv6 automatically? Whatever the reason was, that was the problem.
To prevent it in the future, and for simplification, we can issue the command:
and it will remove it automatically.
A more elegant way to solve the problem will be to implement the IPv6 support within the VB.net system (which I think it is explained here) but that will be done later.
My guess is that MySQL 5.5 is IPv6 aware by default? I didn’t find any way to change that in the settings nor any report of this kind of problem.
I hope this helps to other people with the same problem.
Now I can go to rest…