Search code examples
c#mysql.netmysql.data

Cannot connect to MySql database after updating MySql.Data .NET package to a version newer than 8.0.27


I am using the MySql.Data package in a .NET Framework 4.7.2 application.

When updating MySql.Data to a version newer than 8.0.27, the database connection fails in a previously working project with no other changes. At the time of writing this includes MySql.Data versions: 8.0.28 to 8.0.31.


Solution

  • While not mentioned in the release notes for 8.0.28, it seems the default SSL mode was changed.

    Specifying the SSL Mode in the connection string solved the issue. In my case this was for a local MySql server installation and I used: SSL Mode=None;