Use mono on Linux to connect to the MySQL database

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.