$ docker --version
Docker version 1.12.2, build bb80604
I am developing a web application that uses mysql running on AWS. When I run the web application locally, it connects to the database and works fine. When I run it in a docker container it fails to connect to the database with the message “Error opening conn - Communications link failure”.
While troubleshooting I discovered that the vpc that the database is in uses the same subnet as the default bridge 172.17.0.0/16. I created my own bridge
And ran the container using that, but that still fails to connect with the same message. It seems to take a little longer to fail using mybridge than it does using the default bridge.
Hi! I have the same problem, I can access to AWS RDS from my localhost but when I run my docker-compose and try to connect to AWS RDS the next message is showed:
Warning: mysqli::__construct(): (HY000/1045): Access denied for user ‘xxxx’@‘XX.XX.XX.XX’
I’ve tried to modify the AWS configuration and docker-compose too but still fails.
ISSUE RESOLVED IN MY CASE:
I was running a docker container locally on OSX. I was trying to connect to an AWS RDS instance from inside my container, using the following command:
mysql -h aws-rds-endpoint -P 3306 -u master-username -p
SOLUTION:
I found out that ‘Public Accessibility’ under ‘Connectivity’ for my RDS was set to ‘No’. I modified the setting to ‘Yes’, and it started working.