MySql.Data.MySqlClient.MySqlException: “The host localhost does not support SSL connections.”

大城市里の小女人 提交于 2019-11-26 15:36:31

问题


I use msyql.data 8.08 and .net core to connect to mysql5.7.18 but following exception is being thrown:

MySql.Data.MySqlClient.MySqlException:“The host localhost does not support SSL connections.”

How to deal with it?


回答1:


I had the same problem today when moving from MySql.Data 7.0.7 to 8.0.8. I was able to move forward adding the "SslMode=none" in the connection string.

You will endup with something like:

server={0};user id={1};password={2};persistsecurityinfo=True;port={3};database={4};SslMode=none

(replacing the values with your database details)




回答2:


And if you using a connection pool class, then you might have to do this way:

    string connstring = string.Format("Server=44.55.110.59; database={0}; UID=root; password=Newuser@123; SslMode = none", databaseName);


来源:https://stackoverflow.com/questions/45086283/mysql-data-mysqlclient-mysqlexception-the-host-localhost-does-not-support-ssl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!