Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 45.1Mb
PDF (A4) - 45.2Mb
PDF (RPM) - 40.9Mb
HTML Download (TGZ) - 10.6Mb
HTML Download (Zip) - 10.6Mb
HTML Download (RPM) - 9.2Mb
Man Pages (TGZ) - 207.7Kb
Man Pages (Zip) - 309.9Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb
Excerpts from this Manual

MySQL 8.0 Reference Manual  /  ...  /  Connecting Using IPv6 Nonlocal Host Addresses Connecting Using IPv6 Nonlocal Host Addresses

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::1
Client host: 2001:db8:0:f101::2

These addresses are chosen from the nonroutable address range recommended by IANA for documentation purposes and suffice for testing on your local network. To accept IPv6 connections from clients outside the local network, the server host must have a public address. If your network provider assigns you an IPv6 address, you can use that. Otherwise, another way to obtain an address is to use an IPv6 broker; see Section, “Obtaining an IPv6 Address from a Broker”.

  1. Start the MySQL server with an appropriate --bind-address option to permit it to accept IPv6 connections. For example, put the following lines in the server option file and restart the server:

    bind-address = *

    Specifying * (or ::) as the value for --bind-address permits both IPv4 and IPv6 connections on all server host IPv4 and IPv6 interfaces. If you want to bind the server to a specific list of addresses, you can do this as of MySQL 8.0.13 by specifying a comma-separated list of values for --bind-address. This example specifies an IPv4 address as well as the required server host IPv6 address:

    bind-address =,2001:db8:0:f101::1

    For more information, see the --bind-address description in Section 5.1.7, “Server Command Options”.

  2. 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';
  3. 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
  4. 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 | ::             |

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.