Spec-Zone .ru
спецификации, руководства, описания, API
|
The following procedure shows how to configure MySQL to permit IPv6 connections by remote clients. It is similar to the preceding procedure for local clients, but the server and client hosts are distinct and each has its own nonlocal IPv6 address. The example uses these addresses:
Server host: 2001:db8:0:f101::1Client host: 2001:db8:0:f101::2
These addresses are chosen from the nonroutable address range recommended by
Start the MySQL server with an appropriate --bind-address
option to permit it to accept IPv6 connections. For
example, put the following lines in your server option file and restart the server:
[mysqld]bind-address = * # before 5.6.6, use :: rather than *
Alternatively, you can bind the server to 2001:db8:0:f101::1
, but that
makes the server more restrictive for TCP/IP connections. It accepts only IPv6 connections for that
single address and rejects IPv4 connections. For more information, see Section
5.1.9.2, "Configuring the MySQL Server to Permit IPv6 Connections".
On the server host (2001:db8:0:f101::1
), create an
account for a user who will connect from the client host (2001:db8:0:f101::2
):
mysql> CREATE USER
'remoteipv6user'@'2001:db8:0:f101::2' IDENTIFIED BY 'remoteipv6pass';
On the client host (2001:db8:0:f101::2
), invoke the mysql client to connect to the server using the new
account:
shell> mysql -h 2001:db8:0:f101::1 -u
remoteipv6user -premoteipv6pass
Try some simple statements that show connection information:
mysql>STATUS
...Connection: 2001:db8:0:f101::1 via TCP/IP...mysql>SELECT CURRENT_USER(), @@bind_address;
+-----------------------------------+----------------+| CURRENT_USER() | @@bind_address |+-----------------------------------+----------------+| remoteipv6user@2001:db8:0:f101::2 | :: |+-----------------------------------+----------------+