I just created a new Compute Engine instance and Cloud SQL (second generation) and Im trying to get the Cloud SQL proxy working so I can connect to Cloud SQL from Compute Engine. Here's how I installed the proxy:
wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64
mv cloud_sql_proxy.linux.amd64 cloud_sql_proxy
chmod +x cloud_sql_proxy
sudo mkdir /cloudsql; sudo chmod 777 /cloudsql
Now when I try to run the Proxy Im getting an error. Here's how Im running the proxy:
sudo ./cloud_sql_proxy -dir=/cloudsql -fuse
Here's the error Im getting:
2016/04/09 03:42:37 Protocol tcp6 not supported: listen tcp6 [::1]:0: bind: cannot assign requested address
2016/04/09 03:42:37 couldn't unmount fuse directory "/cloudsql": &exec.Error{Name:"fusermount", Err:(*errors.errorS tring)(0xc820011250)}
2016/04/09 03:42:37 Mounting "/cloudsql"...
2016/04/09 03:42:37 Could not start fuse directory at "/cloudsql": cannot mount "/cloudsql": fusermount: exec: "fusermount": executable file not found in $PATH
UPDATE:
Got this working without using Fuse. Here's the command I ran:
./cloud_sql_proxy -dir=/cloudsql --instances=my-project:us-central1:my-sql-instance-name=tcp:3306 &
mysql -u root --port 3306 --host 127.0.0.1 -p
I still see the error Protocol tcp6 not supported: listen tcp6 [::1]:0: bind: cannot assign requested address but I guess its just a warning?