Unable to connect to any of the specified MySQL hosts
Posted by: Joshua Brickel
Date: November 17, 2004 02:28PM


I'm using Debian with MySQL 4.0.x using Mono (1.0.4) with version 1.0.2 of MySql.Data.dll.

The following is the error message I get when trying to connect to the database via the MySql library usin g mono:

Unhandled Exception: MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts
in <0x0027f> MySql.Data.MySqlClient.NativeDriver:Open ()
in <0x00033> MySql.Data.MySqlClient.Driver:Create (MySql.Data.MySqlClient.MySqlConnectionString)
in <0x000c6> MySql.Data.MySqlClient.MySqlPool:CreateNewPooledConnection ()
in <0x0022f> MySql.Data.MySqlClient.MySqlPool:GetPooledConnection ()
in <0x0004e> MySql.Data.MySqlClient.MySqlPool:GetConnection ()
in <0x00124> MySql.Data.MySqlClient.MySqlPoolManager:GetConnection (MySql.Data.MySqlClient.MySqlConnectionString)
in <0x00078> MySql.Data.MySqlClient.MySqlConnection:Open ()

The pertinent code used in this is:
MySql.Data.MySqlClient.MySqlConnection myConnection;
myConnection = new MySql.Data.MySqlClient.MySqlConnection();
myConnection.ConnectionString = "database=test;server=localhost;user id=mytest; pwd=mytest;";

But I can connect to the database without a problem as in:
andromeda:~# mysql -u mytest -pmytest
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.21-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


Any help in resolving this matter would be greatly appreciated.



Options: ReplyQuote

Written By
Unable to connect to any of the specified MySQL hosts
November 17, 2004 02:28PM

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.