新聞中心
此文章主要向大家描述的是在Linux上使用Mono來連接MySQL數(shù)據(jù)庫(kù)的一大絕招,我們大家都知道連接MySQL數(shù)據(jù)庫(kù)在實(shí)際應(yīng)用中是經(jīng)常出現(xiàn)的,所以很多人對(duì)其也是備受關(guān)注的。其具體內(nèi)容參考的例子可以再相關(guān)網(wǎng)站上查詢。

10年積累的網(wǎng)站設(shè)計(jì)制作、成都做網(wǎng)站經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站策劃后付款的網(wǎng)站建設(shè)流程,更有臨縣免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
特別提出來的是我***次編譯運(yùn)行的時(shí)候出現(xiàn)這樣的錯(cuò)誤提示:
- 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 ()
不思不得其解,后來找到一個(gè)國(guó)外的論壇,得到這樣的提示:
- The most likely cause of this is that MySQL is not configured to accept tcp/ip connections.
- See 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.
根據(jù)提示我把my.cnf中的
- # 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
bind-address注釋掉,然后重新啟動(dòng)mysql服務(wù)器程序sudo /etc/init.d/mysql restart就可以正常連接查詢了。以上的相關(guān)內(nèi)容就是對(duì)在Linux上使用Mono連接MySQL數(shù)據(jù)庫(kù)的介紹,望你能有所收獲。
上述的相關(guān)內(nèi)容就是對(duì)在Linux上使用Mono連接MySQL數(shù)據(jù)庫(kù)的描述,希望會(huì)給你帶來一些幫助在此方面。
網(wǎng)頁(yè)名稱:用Mono來連接MySQL數(shù)據(jù)庫(kù)在Linux上
當(dāng)前地址:http://fisionsoft.com.cn/article/djspopi.html


咨詢
建站咨詢
