Edit
The instructions above did not work, it was showing another message.
The first time you'll need to run the command below:
gcloud beta sql connect <instance id> --project <project id>:us-central1 --user root
Also, I switch to my project in the console:
gcloud config set project <project id>
However, I am now getting another error:
ERROR: (gcloud.beta.sql.connect) The client is not authorized to make this request.
I guess I'll need to allow the clients...
Another Edit re Allowing Clients
To finally connect to the DB I had install Google SQL Proxy.
I set it up with FUSE (I use a Mac). After opening a connection following the instructions in the Google Docs. I was able to connect via the mysql command line.
$ mysql -u root -p -S <localtion of cloud sql proxy folder>/<project id>:us-central1:<db instance id>
Original
Just figured this one out. Here's how to do it:
Click on the instance you want to connect
In the Overview
section, scroll down to Properties
.
In Properties
you will see Instance connection name
. It will look something like <your project>:us-central1:<instance name>
Use that in the command:
$ gcloud beta sql connect <your project>:us-central1:<instance name> --user root