App Engine phpmyadmin cannot connect to my Cloud SQL instance

187 views
Skip to first unread message

K S

unread,
May 21, 2019, 12:45:37 PM5/21/19
to Google Cloud SQL discuss
Here's the tutorial I've followed:
https://cloud.google.com/sql/docs/mysql/phpmyadmin-on-app-engine

Once I deploy, I see the phpmyadmin index page, asking for me to log in. When I try, I get following messages:
Cannot log in to the MySQL server

mysqli_real_connect
(): MySQL server has gone away
mysqli_real_connect
(): Error while reading greeting packet. PID=-1
mysqli_real_connect
(): (HY000/2006): MySQL server has gone away



this is what I used for my instance name
myprojectID:us-west1:mycloudsqlname

I can't figure out what I'm doing wrong. I tried the both version on the doc and the latest doc.
I tried to allow unsecure connections for Cloud SQL, didn't work.
App Engine authorization under "Connections" tab is checked greed - Apps in this project: All authorized.
I'm only using Private IP address, associated with "default" network setting.
Nothing on logs.

Can someone confirm that the tutorial above is working?
Any help would be appreciated.

K S

unread,
May 26, 2019, 2:37:18 PM5/26/19
to Google Cloud SQL discuss
I've found the solution: I had to enable the Public IP Address from Connection tab.
I still don't understand why I have to enable public IP address, when I want to connect between Cloud SQL and App Engine; they're all GCP services. I didn't have to enable Public IP address to connect Cloud SQL from my Compute Engine.
My Cloud SQL service is now ping-able, which makes me nervous too.

Tiago (Google Cloud Platform Support)

unread,
May 27, 2019, 6:59:18 PM5/27/19
to Google Cloud SQL discuss
Hello, as relayed in the Private IP - Application environment requirements documentation, it's not possible to connect through private IP from standard environment. In order to only connect through private IP, you must use flexible environment instead.

Kurtis Van Gent

unread,
May 28, 2019, 10:45:49 AM5/28/19
to Google Cloud SQL discuss
Hey KS,

Just as an FYI, you can grant your Serverless Environments access to a VPC with the Serverless VPC Connector (in beta).

Thanks,
Kurtis
Reply all
Reply to author
Forward
0 new messages