How to connect to mysql using ipv6 from wordpress

I’m trying to connect to a MySQL host that only expose an IPv6 address from WordPress running in Docker. I try to add the IP to the host like this:

$ docker run --name some-wordpress -e WORDPRESS_DB_HOST=<my_ipv6_addr> \
    -e WORDPRESS_DB_USER=... -e WORDPRESS_DB_PASSWORD=... -d wordpress

Where <my_ipv6_addr is the IPv6 address to the MySQL host. But wordpress fails to connect with the following error message:

  • Can you share Docker containers?
  • PostgreSQL Docker installation how to setup initial database
  • Unable to do port forwarding: socat not found. Kubernetes on Docker
  • Is it possible to access a hardware device with a docker image under Windows?
  • Deploy Meteor 1.3, React app on AWS
  • Deleted Docker Image, How to Create New from Container?
  • Warning: mysqli::mysqli(): (HY000/2002): Invalid argument in - on line 10

    Is there a way to connect WordPress to MySQL in Docker using IPv6?

  • Dockerfile - Mount host directory - copy a tar fie and run it - Error
  • what is the exact difference between YAML version 1 and YAML version 2?
  • Can I ask for RAM of container exceed the physical memory on the single host with Docker-Swarm
  • Running npm update inside dockers
  • Docker Container fails to connect to remote SQL
  • Docker unreachable after computer sleep
  • One Solution collect form web for “How to connect to mysql using ipv6 from wordpress”

    Make sure that your docker daemon is running with the --ipv6 flag

    By default, the Docker server configures the container network for IPv4 only.
    You can enable IPv4/IPv6 dualstack support by running the Docker daemon with the --ipv6 flag. Docker will set up the bridge docker0 with the IPv6 link-local address fe80::1.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.