- 7.1.13.1 验证系统对 IPv6 的支持7.1.13.1 Verifying System Support for IPv6
- 7.1.13.2 配置 MySQL 服务器以允许 IPv6 连接7.1.13.2 Configuring the MySQL Server to Permit IPv6 Connections
- 7.1.13.3 使用 IPv6 本地主机地址连接7.1.13.3 Connecting Using the IPv6 Local Host Address
- 7.1.13.4 使用 IPv6 非本地主机地址连接7.1.13.4 Connecting Using IPv6 Nonlocal Host Addresses
- 7.1.13.5 从代理获取 IPv6 地址7.1.13.5 Obtaining an IPv6 Address from a Broker
MySQL 对 IPv6 的支持包括以下功能:Support for IPv6 in MySQL includes these capabilities:
MySQL 服务器可以接受通过 IPv6 连接的客户端的 TCP/IP 连接。例如,以下命令通过 IPv6 连接到本地主机上的 MySQL 服务器:MySQL Server can accept TCP/IP connections from clients connecting over IPv6. For example, this command connects over IPv6 to the MySQL server on the local host:
$>
mysql -h ::1要使用此功能,必须满足两项条件:To use this capability, two things must be true:
您的系统必须配置为支持 IPv6。请参阅 第 7.1.13.1 节,“验证系统对 IPv6 的支持”。Your system must be configured to support IPv6. See Section 7.1.13.1, “Verifying System Support for IPv6”.
默认的 MySQL 服务器配置允许 IPv6 连接以及 IPv4 连接。要更改默认配置,请通过将
bind_address系统变量设置为适当的值来启动服务器。请参阅 第 7.1.8 节,“服务器系统变量”。The default MySQL server configuration permits IPv6 connections in addition to IPv4 connections. To change the default configuration, start the server with thebind_addresssystem variable set to an appropriate value. See Section 7.1.8, “Server System Variables”.
MySQL 帐号名称允许使用 IPv6 地址,以便 DBA 为通过 IPv6 连接到服务器的客户端指定权限。请参阅 第 8.2.4 节,“指定帐号名称”。IPv6 地址可以在诸如
CREATE USER、GRANT和REVOKE之类的语句中指定。例如:MySQL account names permit IPv6 addresses to enable DBAs to specify privileges for clients that connect to the server over IPv6. See Section 8.2.4, “Specifying Account Names”. IPv6 addresses can be specified in account names in statements such asCREATE USER,GRANT, andREVOKE. For example:mysql>
CREATE USER 'bill'@'::1' IDENTIFIED BY 'secret';mysql>GRANT SELECT ON mydb.* TO 'bill'@'::1';IPv6 函数可以在字符串与内部格式的 IPv6 地址之间进行转换,并检查值是否表示有效的 IPv6 地址。例如,
INET6_ATON()和INET6_NTOA()类似于INET_ATON()和INET_NTOA(),但它们不仅处理 IPv4 地址,还处理 IPv6 地址。参见 第 14.23 节,“杂项函数”。IPv6 functions enable conversion between string and internal format IPv6 address formats, and checking whether values represent valid IPv6 addresses. For example,INET6_ATON()andINET6_NTOA()are similar toINET_ATON()andINET_NTOA(), but handle IPv6 addresses in addition to IPv4 addresses. See Section 14.23, “Miscellaneous Functions”.组复制的组成员可以使用 IPv6 地址在组内进行通信。一个组可以包含使用 IPv6 的成员和使用 IPv4 的成员的混合。请参见 第 20.5.5 节,“支持 IPv6 以及混合 IPv6 和 IPv4 组”。Group Replication group members can use IPv6 addresses for communications within the group. A group can contain a mix of members using IPv6 and members using IPv4. See Section 20.5.5, “Support For IPv6 And For Mixed IPv6 And IPv4 Groups”.
以下部分描述了如何设置 MySQL,使客户端能够通过 IPv6 连接到服务器。The following sections describe how to set up MySQL so that clients can connect to the server over IPv6.