- 问题描述:如下代码会抛异常:The host 127.0.0.1 does not support SSL connections.
string str = "Database=msgboard;Data Source=127.0.0.1;";//SslMode=none;
str += "User Id=root;port=3306";
sqlConn = new MySqlConnection(str);
try
{
sqlConn.Open();
Console.WriteLine("数据库连接成功");
}catch(Exception ex)
{
Console.WriteLine("[数据库]连接失败"+ex.Message);
}
string str = "Database=msgboard;Data Source=127.0.0.1;SslMode=none;";
str += "User Id=root;port=3306";
sqlConn = new MySqlConnection(str);
try
{
sqlConn.Open();
Console.WriteLine("数据库连接成功");
}catch(Exception ex)
{
Console.WriteLine("[数据库]连接失败"+ex.Message);
}