通过IPv6连接数据库的方法
本文总结了配置和验证MySQL数据库支持IPV6的方法,并扩展使用jdbc连接其他主流数据库url的方法,包括ipv4及ipv6两种连接格式。
ping6 -I eth0 ipv6
-
验证操作系统是否支持ipv6
-
本机测试:ping6 ::1//ifconfig
[root@XXX-ipv6 ~]# ping6 ::1 PING ::1(::1) 56 data bytes 64 bytes from ::1: icmp_seq=1 ttl=64 time=0.021 ms 64 bytes from ::1: icmp_seq=2 ttl=64 time=0.039 ms 64 bytes from ::1: icmp_seq=3 ttl=64 time=0.037 ms ^C --- ::1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1999ms rtt min/avg/max/mdev = 0.021/0.032/0.039/0.009 ms
[root@XXX-ipv6 ~]# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450 inet 10.0.0.3 netmask 255.255.240.0 broadcast 10.0.15.255 inet6 2402:db40:5f00:3200:b366:ff34:e0e6:f28 prefixlen 128 scopeid 0x0<global> inet6 fe80::d662:97b7:3976:db84 prefixlen 64 scopeid 0x20<link> ether fa:16:3e:1b:6f:bd txqueuelen 1000 (Ethernet) RX packets 3143399 bytes 1013069846 (966.1 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4288824 bytes 1472280674 (1.3 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Loca
-