PDOException: SQLSTATE[HY000] [2003] Can't connect to MySQL server
For anyone having the SAME error code, please check if you have SELinux enable by typing sestatus. If that's the case then your firewall is most likely blocking the connection to the db. 

To allow it you can use the following command line :

setsebool httpd_can_network_connect_db=1