I am having problems connecting a GCP Compute Engine VM to a Cloud SQL instance configured with private IP (no public) via Cloud SQL Auth Proxy.
After executing
$ ./cloud_sql_proxy -instances=INSTANCE_CONN_NAME=tcp:3306
I see the following output:
2021/10/11 12:29:24 Rlimits for file descriptors set to {Current = 8500, Max = 1048576}
2021/10/11 12:29:28 Listening on 127.0.0.1:3306 for *CLOUD-SQL-CONNECTION-NAME*
2021/10/11 12:29:28 Ready for new connections
2021/10/11 12:29:28 Generated RSA key in 101.010024ms
I haven't seen the final statement on the above on any of the tutorials I have read on this subject.
I CTRL-C out of the above, and I am shown:
^C2021/10/11 12:29:39 Received TERM signal. Waiting up to 0s before terminating.
I then run the below command to connect to my Cloud SQL instance:
mysql -u root -p --host 127.0.0.1
which returns:
Enter password: (password entered)
that returns once the password entered:
ERROR 2005 (HY000): Unknown MySQL server host 'CLOUD-SQL-PROXY-IP-ADDRESS:3306' (22)
Here are some additional information:
- My VM (Ubuntu) is in the same region as my Cloud SQL instance, and in the same VPC network.
- My CLoud SQL Admin API is enabled
- The Cloud SQL instance is configured with only Private IP (Not public)
- I have installed the MySQL client in my VM
- The scope of the Cloud Access API's on my VM includes Cloud SQL (full access to all API's)
- Both myself and the VM's service account has Cloud SQL Admin permissions
CLOUD-SQL-PROXY-IP-ADDRESSrefers to in your installation?