Azure Database for MySQL 中的 SSL 连接SSL connectivity in Azure Database for MySQL


将要查看的是 Azure Database for MySQL 的新服务。You are viewing the new service of Azure Database for MySQL. 若要查看经典 MySQL Database for Azure 的文档,请访问此页To view the documentation for classic MySQL Database for Azure, please visit this page.

Azure Database for MySQL 支持使用安全套接字层 (SSL) 将数据库服务器连接到客户端应用程序。Azure Database for MySQL supports connecting your database server to client applications using Secure Sockets Layer (SSL). 通过在数据库服务器与客户端应用程序之间强制实施 SSL 连接,可以加密服务器与应用程序之间的数据流,有助于防止“中间人”攻击。Enforcing SSL connections between your database server and your client applications helps protect against "man in the middle" attacks by encrypting the data stream between the server and your application.

SSL 默认设置SSL Default settings

默认情况下,应将数据库服务配置为需要 SSL 连接才可连接到 MySQL。By default, the database service should be configured to require SSL connections when connecting to MySQL. 建议尽量不要禁用 SSL 选项。We recommend to avoid disabling the SSL option whenever possible.

通过 Azure 门户和 CLI 预配新的 Azure Database for MySQL 服务器时,默认情况下会强制实施 SSL 连接。When provisioning a new Azure Database for MySQL server through the Azure portal and CLI, enforcement of SSL connections is enabled by default.

Azure 门户中显示了各种编程语言的连接字符串。Connection strings for various programming languages are shown in the Azure portal. 这些连接字符串包含连接到数据库所需的 SSL 参数。Those connection strings include the required SSL parameters to connect to your database. 在 Azure 门户中,选择服务器。In the Azure portal, select your server. 在“设置”标题下,选择“连接字符串” 。Under the Settings heading, select the Connection strings. SSL 参数因连接器而异,例如“ssl=true”、“sslmode=require”或“sslmode=required”,以及其他变体。The SSL parameter varies based on the connector, for example "ssl=true" or "sslmode=require" or "sslmode=required" and other variations.

若要了解如何在开发应用程序期间启用或禁用 SSL 连接,请参阅如何配置 SSLTo learn how to enable or disable SSL connection when developing application, refer to How to configure SSL.

后续步骤Next steps

Azure Database for MySQL 的连接库Connection libraries for Azure Database for MySQL