解决方案:
连接字符串添加如下语句.
SslMode = none;
-
static void Main(string[] args) -
{ -
Console.WriteLine("123"); -
string connectstr="server=localhost;port=3306;database=test;user=root;password=;SslMode = none;"; -
MySqlConnection conn=new MySqlConnection(connectstr); -
try { -
conn.Open(); -
Console.WriteLine("连接成功!!!"); -
} catch (Exception e) { -
Console.WriteLine(e.ToString()); -
}finally{ -
conn.Close(); -
Console.WriteLine("正常关闭!!!"); -
} -
Console.ReadKey(); - }
博客给出一种解决方案,即向连接字符串添加特定语句,但未明确具体语句内容。
3401

被折叠的 条评论
为什么被折叠?



