📜  使用 c# 连接到我的云 sql 服务器 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:22.399000             🧑  作者: Mango

代码示例1
var csb = new MySqlConnectionStringBuilder
{
    Server = "Google Cloud SQL IP address",
    UserID = "Your UserName",
    Password = "Your Password",
    Database = "Your Database/Schema Name",
    SslCert = @"C:\Path\To\client-cert.pem",
    SslKey = @"C:\Path\To\client-key.pem",
    SslCa = @"C:\Path\To\server-ca.pem",
    SslMode = MySqlSslMode.VerifyCA,
};

using var connection = new MySqlConnection(csb.ConnectionString);
connection.Open();