1var csb = new MySqlConnectionStringBuilder
2{
3 Server = "Google Cloud SQL IP address",
4 UserID = "Your UserName",
5 Password = "Your Password",
6 Database = "Your Database/Schema Name",
7 SslCert = @"C:\Path\To\client-cert.pem",
8 SslKey = @"C:\Path\To\client-key.pem",
9 SslCa = @"C:\Path\To\server-ca.pem",
10 SslMode = MySqlSslMode.VerifyCA,
11};
12
13using var connection = new MySqlConnection(csb.ConnectionString);
14connection.Open();
15