I successfully created a Compute Engine VM instance, and installed MySQL on it using this guide: https://cloud.google.com/solutions/setup-mysql
Now I want to connect to it from App Engine and from my home too if possible. Using this guide: https://cloud.google.com/appengine/docs/standard/python/connecting-vpc I created the connector, giving it the suggested 10.8.0.0/28 IP address.
In my app engine's app.yaml I inserted: vpc_access_connector: name: projects/locationconnection/locations/europe-west3/connectors/vpcaccess
The VM instance shows an internal IP of 10.156.0.2 and an external IP of 22.214.171.124
I am trying to connect from PHP using this line: new mysqli($servername, $username, $password, $dbname, 3306, null); but I get different errors.
When connecting to 126.96.36.199 from my home: mysqli::__construct(): (HY000/2002): No connection could be made because the target machine actively refused it. (I even created a Firewall rule to allow all traffic from my home IP)
When connecting to 10.8.0.0 from app engine: 2002: Connection timed out
When connecting to 10.156.0.2 from app engine: 2002: Connection refused
How can I make a connection?