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
标签:c#,Open,error,MySqlClient,MySqlPool,SSL,Connection,MySql,Data 来源: https://blog.csdn.net/photon222/article/details/120826338