Re: MySqlException: Unable to connect to any of the specified MySQL hosts
Posted by: Irwan Hassan
Date: April 25, 2009 07:45AM

Hi all,

I was having the same problem.

MySQL Server 5.1.32, MySQL.Net Connector 5.2.5 and using Visual Studio 2008 on Windows Vista.

I use three different PC/Laptop to develop my application. I was able to connect to the server without any problem in Windows XP SP3 but Windows Vista can't. So I though it could be Windows Firewall block the connection, but I can use MySQL Query Browser to connect to the specific database.

My Connection String was :
Data Source=localhost;Database=MyDatabase;User ID=MyDBUser;Password=MyPassword;Port=MyPort;

It was keep on denying. So I change the Data Source from localhost to my computer name. It worked without any problem. So I guess this could be something to do with security on Windows Vista. Anyway, it worked.

I guess it may solve your problems too.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySqlException: Unable to connect to any of the specified MySQL hosts
April 25, 2009 07:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.