无法从 Linux Mint 中的 Monodevelop 连接到 MySQL 数据库

Cannot connect to MySQL database from Monodevelop in Linux Mint

我无法从 C# 连接到 MySQL 数据库。在尝试 运行 可执行文件时,它吐出了这个错误(这是它的开始):

Unhandled Exception: System.Data.SqlClient.SqlException (0x80131904): Snix_Connect (provider: SNI_PN7, error: 40 - SNI_ERROR_40) Snix_Connect (provider: SNI_PN7, error: 40 - SNI_ERROR_40) at System.Data.SqlClient.SqlInternalConnectionTds..ctor (System.Data.ProviderBase.DbConnectionPoolIdentity identity, System.Data.SqlClient.SqlConnectionString connectionOptions, System.Data.SqlClient.SqlCredential credential, System.Object providerInfo, System.String newPassword, System.Security.SecureString newSecurePassword, System.Boolean redirectedUserInstance, System.Data.SqlClient.SqlConnectionString userConnectionOptions, System.Data.SqlClient.SessionData reconnectSessionData, System.Boolean applyTransientFaultHandling, System.String accessToken) [0x0018b] in <2ebdad619de74d1389f27154469c7cb1>:0 at System.Data.SqlClient.SqlConnectionFactory.CreateConnection (System.Data.Common.DbConnectionOptions options, System.Data.Common.DbConnectionPoolKey poolKey, System.Object poolGroupProviderInfo, System.Data.ProviderBase.DbConnectionPool pool, System.Data.Common.DbConnection owningConnection, System.Data.Common.DbConnectionOptions userOptions) [0x00159] in <2ebdad619de74d1389f27154469c7cb1>:0

我可以从 MySQL Workbench 连接到数据库就好了。

我尝试使用 Connector/Net 但无济于事。

这是代码:

dbCon = new SqlConnection(
    "Data Source=192.168.0.104, 3306; " +
    "Initial Catalog=Mundus; " + // Mundus is the database that I am trying to connect to
    "User ID=root;" + 
    "Password=[password that I use];"
);

dbCon.Open(); // from here it breaks
using(dbCon) { 
            
}

我的问题是我试图使用 System.Data.SqlClient 连接到 MySQL 数据库(它适用于 Microsoft SQL 数据库)。

在此之后 Whosebug comment 我使用 MySql.Data.MySqlClient 进行连接。这种格式的连接字符串对我有用:

"server=localhost;" +
"port=3306;" +
"user id=root; " +
"password=[my password]; " +
"database=[the database I want to connect to]; " +
"SslMode=none"