c# 连接MySQL 提示SSL Connection error

c# 连接MySQL 提示SSL Connection error
Mysql.Connection调用Open()时报错,try catch得到如下错误信息:
2021-10-18 14:40:23,388 [1] ERROR *** - SSL Connection error.
2021-10-18 14:40:23,390 [1] ERROR *** - at MySql.Data.Common.Ssl.StartSSL(Stream& baseStream, Encoding encoding, String connectionString)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()

解决办法:在连接字符串后面加上 SslMode=None
如下 server=127.0.0.1;port=3306;user id=root;password=zaq;database=yehe;CharSet=utf8mb4;Allow Zero Datetime=true;SslMode=None

Ref:
https://www.cnblogs.com/simadi/p/15235552.html

上一篇:使用H-lua框架制作魔兽争霸地图(7-物编-物品合成篇)


下一篇:Jedis使用lua脚本完成令牌桶限流