Testing Connection to Cloud SQL instance with a MySQL client from VM Instance.

explain it.

Last updated:1/8/2020 11:57:30 PM

1 Answers

Nishi Tiwari
Nishi Tiwari

  •  On the detail page of our Cloud SQL Instance, take note of Public IP address.

Testing Connection to Cloud SQL instance with a MySQL client from VM Instance.

  • Now return to our VM Instance and test our connection.
  •  Click on the Navigation Menu go to Compute Engine then VM Instances.
  • On our newly created VM, Click on SSH, this would open a new window with SSH connection to our VM instance.

Testing Connection to Cloud SQL instance with a MySQL client from VM Instance.

  •  On the SSH window, execute these following commands, remember to change 35.202.255.49 to your own Cloud SQL Instance’s Public IP.
  •  sudo apt-get update
  • sudo apt-get install mysql-client -y
  • mysql — host=35.202.255.49 — user=root — password 
  •  You’ll get a password prompt, enter that password which used when creating the Cloud SQL Instance, if correct, you’ll get connected to your SQL Instance.

Testing Connection to Cloud SQL instance with a MySQL client from VM Instance.

Answer