472,102 Members | 2,019 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,102 software developers and data experts.

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 79610
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
Bassem
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
Bassem
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.