469,903 Members | 1,922 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

How to fix: Unable to connect to any of the specified MySQL hosts

304 100+
Could anyone tell me as to what this error means?

"Unable to connect to any of the specified MySQL hosts"

I am trying to connect to a remote mysql database using asp.net.
Apr 16 '07 #1
5 79050
The Problem occurs when you use a different port number other than the default port number "3306" while configuring the MySQL Database Server. and Don't mention the port number in the Connection String.
Try the following connection string: (replace 3306 with your specified port number for MySQL)
"Server=localhosr:3306;Database=Mydb;User ID=root;Password=xxxx;CharSet=utf8"

If you don't want to change in your code then, re-configure the MySQL database server with default port number "3306".
Feb 24 '08 #2
Just had the same problem

Check your firewall settings

You may need to add an exception for port 3306
Apr 10 '10 #3
344 100+
Same problem here, I reconfigured the MySQL and set the default port 3306, add exception to the firewall, allow remote connection from other machines.

My application was running successfully, but suddenly got this error again, tried the same procedure but didn't work!!

Any one has another idea?
Oct 20 '10 #4
Can you ping the computer that your MySQL db is on from the computer where your app is ?

This will prove whether connection is possible
Oct 20 '10 #5
344 100+
Thank you finked1973 for your reply.

I can open the default website from the browser by typing the ip. This proves the connection is possible, right?
Oct 21 '10 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

20 posts views Thread by Mr Dygi | last post: by
2 posts views Thread by pieter_hordijk | last post: by
reply views Thread by Denis Labon | last post: by
3 posts views Thread by dmcquay | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.