An SSL library is required for support of encrypted connections, entropy for random number generation, and other encryption-related operations.SSL库是支持加密连接、随机数生成熵和其他加密相关操作所必需的。
If you compile MySQL from a source distribution, CMake configures the distribution to use the installed OpenSSL library by default.如果从源发行版编译MySQL,CMake会将发行版配置为默认使用已安装的OpenSSL库。
To compile using OpenSSL, use this procedure:要使用OpenSSL进行编译,请使用以下过程:
Ensure that OpenSSL 1.0.1 or higher is installed on your system. If the installed OpenSSL version is lower than 1.0.1, CMake produces an error at MySQL configuration time. 确保您的系统上安装了OpenSSL 1.0.1或更高版本。如果安装的OpenSSL版本低于1.0.1,CMake会在MySQL配置时产生错误。If it is necessary to obtain OpenSSL, visit http://www.openssl.org.如果有必要获得OpenSSL,请访问http://www.openssl.org。
The WITH_SSL
CMake option determines which SSL library to use for compiling MySQL (see Section 2.9.7, “MySQL Source-Configuration Options”). WITH_SSL
CMake选项确定用于编译MySQL的SSL库(请参阅第2.9.7节,“MySQL源配置选项”)。The default is 默认值为-DWITH_SSL=system
, which uses OpenSSL. -DWITH_SSL=system
,它使用OpenSSL。To make this explicit, specify that option on the CMake command line. For example:若要明确此选项,请在CMake命令行中指定该选项。例如
cmake . -DWITH_SSL=system
That command configures the distribution to use the installed OpenSSL library. 该命令将分发配置为使用已安装的OpenSSL库。Alternatively, to explicitly specify the path name to the OpenSSL installation, use the following syntax. 或者,要显式指定OpenSSL安装的路径名,请使用以下语法。This can be useful if you have multiple versions of OpenSSL installed, to prevent CMake from choosing the wrong one:如果您安装了多个版本的OpenSSL,这将非常有用,以防止CMake选择错误的版本:
cmake . -DWITH_SSL=path_name
Compile and install the distribution.编译并安装分发版。
To check whether a mysqld server supports encrypted connections, examine the value of the 要检查mysqld服务器是否支持加密连接,请检查have_ssl
system variable:have_ssl
系统变量的值:
mysql> SHOW VARIABLES LIKE 'have_ssl';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_ssl | YES |
+---------------+-------+
If the value is 如果该值为YES
, the server supports encrypted connections. YES
,则服务器支持加密连接。If the value is 如果该值为DISABLED
, the server is capable of supporting encrypted connections but was not started with the appropriate --ssl-
options to enable encrypted connections to be used; see Section 6.3.1, “Configuring MySQL to Use Encrypted Connections”.xxx
DISABLED
,则服务器能够支持加密连接,但没有使用适当的--ssl-xxx
选项启动以启用加密连接;请参阅第6.3.1节,“配置MySQL以使用加密连接”。