I’m new working with docker and on the forum, i already saw some post about my issue, but none of the solutions solved my case…
I have a simple ubuntu container with apache and a symfony 3 project, i’m trying to connect my symfony website to my host machine mysql server, but whenever i try to, the ip shown in the PDO connection error message is not the one provided, it is the container address (172.17.0.2 in my case) which is the ip i find in the host machine iptables.
(Even with a simple ‘new PDO’ connection in a CLI script, i got the error: PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]  Access denied for user ‘root’@‘172.17.0.2’ (using password: YES) in /var/www/test.php:6 )
I tried to ACCEPT Docker’s FORWARD for the mysql port in my iptables but nothing works, i may say that i tried with the real IP address and the domain name. whenever i ping the domain name i got the right ip adress but the PDO still gives the same error
Have you guys any idea?