1
votes

I have created a MySql server in Google Cloud SQL and trying it to connect it from my local machine using MySql Workbench but i am not able to establish a connection to it.

I get the following error Failed to Connect to MySQL at {IP-Address}:3306 with user root(10060)

1
You cannot directly connect to a SQL server in GCP. Either you need to use cloud_sql_proxy or you need to whitelist your IP in the DB settings. Are you doing any of these? - amulya349
In order to use Google Cloud SQL with external applications, you need to Authorized IP Addresses of those external applications.To do that in Assign IP Address section 1)Select Assign IP Address radio button. 2)Enter your PC's IP address in “Authorized IP Addresses” box. - Saurabh Ande

1 Answers

7
votes

If you are trying to connect from outside network to gcp sql instance you need to add your public ip of your machine in the connection of sql instance

  1. Go to your sql instance
  2. Go to Connections tab
  3. Under Connectivity select public IP and add a network by giving CIDR for your IP and save it

Then check with your sql client or workbench