[root@CentOS8 init.d]# ping6 ::1 PING ::1(::1) 56 data bytes 64 bytes from ::1: icmp_seq=1 ttl=64 time=0.741 ms 64 bytes from ::1: icmp_seq=2 ttl=64 time=0.055 ms 64 bytes from ::1: icmp_seq=3 ttl=64 time=0.052 ms 64 bytes from ::1: icmp_seq=4 ttl=64 time=0.100 ms 64 bytes from ::1: icmp_seq=5 ttl=64 time=0.074 m
2.以管理员身份,连接到服务器并为本地用户创建一个帐户,该帐户将通过:: 1本地IPv6主机地址进行连接:
mysql> CREATE USER 'ipv6user'@'::1' IDENTIFIED BY 'ipv6pass';
3.调用mysql客户端以使用新帐户连接到服务器:
shell> mysql -h ::1 -u ipv6user -pipv6pass
4.尝试一些显示连接信息的简单语句: mysql> status
--------------
mysql Ver 8.0.19 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
Connection id: 10
Current database:
Current user: root@localhost
SSL: Cipher in use is TLS_AES_256_GCM_SHA384
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.19 MySQL Community Server - GPL
Protocol version: 10 Connection: ::1 via TCP/IP
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4 TCP port: 3306
Binary data as: Hexadecimal
Uptime: 47 min 27 sec
Threads: 3 Questions: 11 Slow queries: 0 Opens: 132 Flush tables: 3 Open tables: 52 Queries per second avg: 0.003
上面的信息可以与socket登录的做比较: mysql> status
--------------
mysql Ver 8.0.19 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
Connection id: 8
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.19 MySQL Community Server - GPL
Protocol version: 10 Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4 UNIX socket: /tmp/mysql.sock
Binary data as: Hexadecimal
Uptime: 46 min 48 sec
Threads: 2 Questions: 7 Slow queries: 0 Opens: 132 Flush tables: 3 Open tables: 52 Queries per second avg: 0.002