How to connect to cloud sql using cloud shell and SSL?

266 views
Skip to first unread message

Bilal Haidar

unread,
Jun 15, 2021, 2:16:58 AM6/15/21
to Google App Engine

Hi,
My database instance has SSL enabled. When I try to connect to it via Cloud Shell, I get the famous message "ERROR 1045 (28000): Access denied for user".

When I remove SSL from the instance, I can connect to it.

Even when using SSL, the IP of the cloud shell is automatically whitelisted. Still, cannot connect.

Any idea?

Thanks

goya

unread,
Jun 15, 2021, 8:02:40 AM6/15/21
to Google App Engine

When your Cloud SQL instance has SSL, you cannot directly connect to it from the Cloud Shell. You need to install the Cloud SQL Auth proxy in the Cloud Shell [1] and connect to the instance using it.



[1]: https://cloud.google.com/sql/docs/mysql/connect-admin-ip#:~:text=The%20gcloud%20sql%20connect%20command%20does%20not%20support%20connecting%20to%20a%20Cloud%20SQL%20instance 

Bilal Haidar

unread,
Jun 15, 2021, 8:23:25 AM6/15/21
to Google App Engine
Thanks goya! Super clean
Reply all
Reply to author
Forward
0 new messages