My testing platform is Ubuntu + mono1.2.4 + mysql5 + connector/NET 5.1.4. Mono and MySQL are easy to install using apt-Get. MySQL connector/NET 5.1.4 Download Windows source and binaries from the http://dev.mysql.com/downloads/connector/net/5.1.html, decompress no installer (ZIP) to obtain mysql. Data. dll.
Use gacutil-I mysql. Data. DLL to install mysql. Data. DLL to the mono global component directory.
For more information, see http://www.mono-project.com/mysql.
In particular, this error message is prompted during the first compilation and running:
MySQL. Data. mysqlclient. mysqlexception: Unable to connect to any of the specified MySQL hosts
In <0x006c5> mysql. Data. mysqlclient. nativedriver: open ()
In <0x00027> mysql. Data. mysqlclient. DRIVER: Create (MySQL. Data. mysqlclient. mysqlconnectionstring settings)
In <0x0008d> mysql. Data. mysqlclient. mysqlpool: createnewpooledconnection ()
In <0x001b0> mysql. Data. mysqlclient. mysqlpool: getpooledconnection ()
In <0x0003f> mysql. Data. mysqlclient. mysqlpool: getconnection ()
In <0x000e5> mysql. Data. mysqlclient. mysqlpoolmanager: getconnection (MySQL. Data. mysqlclient. mysqlconnectionstring settings)
In <0x00050> mysql. Data. mysqlclient. mysqlconnection: open ()
after finding a Foreign Forum, I got the following prompt:
the most likely cause of this is that MySQL is not configured to accept TCP/IP connections.
here http://dev.mysql.com/doc/mysql/en/can-not-connect-to-server.html
make
sure your/etc/MySQL/My. CNF file does not have the "Skip-Networking"
feature enabled. this is the default in some installations and disables
TCP/IP connections.
follow the prompts to change my.
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address = 172.22.60.126
comment out bind-address, then restart the MySQL server Program sudo/etc/init. d/MySQL restart can be used for normal connection query.
good luck!