I want to connect to a remote MySQL instance (a Google Cloud SQL one) by using its IPv6 address.
I'm using PHP PDO like that:
$db = new \PDO('mysql:host=<ipv6-address>;port=3306;dbname=<database-name>',
'<username>',
'<password>'
);
But it always fails with the following exception message:
PDOException: SQLSTATE[HY000] [2002] No route to host
From the terminal I can connect to the MySQL instance, without any issue, like this:
mysql --host=<ipv6-address> --user=<username> --<password>
Any help will be really appreciated.
Thanks