I am trying to run the Wordpress container, configured to use an external MySQL database server like so:
docker run --name wordpress1 -p 801:80 -e WORDPRESS_DB_HOST=MYDBSERVERIPADDRESS:3306 -e WORDPRESS_DB_USER=username -e WORDPRESS_DB_PASSWORD=password -e WORDPRESS_DB_NAME=dbname -it wordpress
However, when I do so I get this error:
MySQL Connection Error: (1045) Access denied for 'username'@'WRONGIPADDRESS' (using password: YES)
The problem is that it is using the IP address of the container host (what I listed as WRONGIPADDRESS), not the IP address that I specified using the WORDPRESS_DB_HOST parameter - it is essentially ignoring the WORDPRESS_DB_HOST parameter completely.
Any idea why this would be happening? This is supposed to be a fully supported -e parameter to a very popular container, Wordpress, so any help you can provide is greatly appreciated.