MySQL Variables tls_version 数据库 参数变量解释及正确配置使用

本站中文解释

TLS版本参数调整MySQL用于安全连接及传输数据的TLS(Transport Layer Security)协议的版本。可以设置TLS版本参数为以下值:

1. TLSv1:此版本对应于TLSv1.0,允许使用SSL 3.0、TLS 1.0、 TLS 1.1和TLS 1.2;

2. TLSv1.1:此版本对应于TLSv1.1,允许使用TLS 1.1和TLS 1.2;

3. TLSv1.2:此版本对应于TLSv1.2,允许使用TLS 1.2。

设置mysql的tls版本是非常重要的,以确保在传输数据时保持安全性。具体步骤如下:

步骤1:在MySQL的配置文件(my.cnf)中设置tls_version属性。

例如,设置上面提到的任何受支持的TLS版本都可以使用以下行指令:

tls_version = TLSv1.2

步骤2:重新启动MySQL服务器

步骤3:检查新配置

接下来可以使用’mysql’命令行客户端来检查版本:

mysql > show global variables like ‘tls_version’;

+—————-+——-+

| Variable_name | Value |

+—————-+——-+

| tls_version | TLSv1.2 |

+—————-+——-+

1 row in set (0.00 sec)

官方英文解释

tls_version

Command-Line Format --tls-version=protocol_list
Introduced 5.7.10
System Variable tls_version
Scope Global
Dynamic No
Type String
Default Value (≥ 5.7.28) TLSv1,TLSv1.1,TLSv1.2
Default Value (≤ 5.7.27)

TLSv1,TLSv1.1,TLSv1.2 (OpenSSL)

TLSv1,TLSv1.1 (yaSSL)

Which protocols the server permits for encrypted connections.
The value is a comma-separated list containing one or more
protocol versions. The protocols that can be named for this
variable depend on the SSL library used to compile MySQL.
Permitted protocols should be chosen such as not to leave
holes in the list. For details, see
Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”.

Note

As of MySQL 5.7.35, the TLSv1 and TLSv1.1 connection
protocols are deprecated and support for them is subject to
removal in a future version of MySQL. See
Deprecated TLS Protocols.


数据运维技术 » MySQL Variables tls_version 数据库 参数变量解释及正确配置使用