Seems like issue persists because of your connectionString
, it should be like.
string connectionString = "Server=localhost;Database=your_database;User=your_username;Password=your_password;SslMode=none;"
Note:- if still facing the same error make sure you have installed MySql.Data
package, if already installed than update it to latest as per the release with your dotnet core version.