You need to add Reference of "MySql.Data" and then need to write your code as
using MySql.Data.MySqlClient;
MySqlConnection con = new MySqlConnection("server=localhost;database=yourdatabase;uid=root;password=yourpassword");
con.Open();
you will fine plenty of article related to connection string for mySQl in C#
Connecting to MySQL Database using C# [
^]