By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,786 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,786 IT Pros & Developers. It's quick & easy.

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

P: 304
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
Apr 16 '07 #1
Share this Question
Share on Google+
5 Replies

P: 1
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

P: 20
Just had the same problem

Check your firewall settings

You may need to add an exception for port 3306
Apr 10 '10 #3

P: 344
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

P: 20
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

P: 344
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.