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.x.x.x/28 IP address.
In my app engine's app.yaml I inserted: vpc_access_connector: name: projects/xxxxxxxxxx/locations/europe-west3/conectors/xxxxxx
The VM instance shows an internal IP of 10.x.x.x and an external IP of 34.x.x.x
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 34.x.x.x 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 to10.x.x.x from app engine: 2002: Connection timed out
When connecting to 10.x.x.x from app engine: 2002: Connection refused
How can I make a connection?