簡體   English   中英

MySQL無法打開與SQL Server的連接

[英]MySQL Could not open a connection to SQL Server

我正在嘗試通過asp.net Web服務連接到mysql數據庫,但它給了我這個錯誤

A network-related or instance-specific error occured while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that the SQL server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

我正在使用MySQL數據庫,連接字符串為

"Data Source=localhost;Initial Catalog=test;User Id=root;Password=;Integrated Security=True"

到目前為止,我幾乎看到的所有解決方案都是針對MS SQL的。 提前致謝

有點忙,但是今天決定坐下來真正地解決它,這就是我的解決方法,我為該項目添加了對MySQL數據的引用(當然,在安裝.net連接器之后),然后改用了MySql.Data.MySqlClient導入System.Data.SqlClient和其他所有內容(例如代替SqlConnection)更改為MySqlConnection和voila,因為MySQL就像一個魅力

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM