Can't connect from Compute Engine

86 views
Skip to first unread message

Javier Orellana

unread,
Oct 15, 2013, 8:46:20 AM10/15/13
to google-cloud...@googlegroups.com
Hi,

I'm trying to connect to Google Cloud SQL from my instance in Compute Engine, but I can't find the way to make it work.

I created a simple PHP script to test the connection before configuring the Doctrine connection in my application.
I've followed the instructions in the Developers doc, and tried both PDO and mysql() approaches.

1) $conn = new PDO('mysql:unix_socket=/cloudsql/just-vent-365:echo-bd;charset=utf8;database='.$database, $user, $password); 

2) mysql_connect(':/cloudsql/just-vent-365:echo-bd',$user,$password);

with the user 'root' and empty password.

However I always get this socket error:

Can't connect to local MySQL server through socket '/cloudsql/just-vent-365:echo-bd

Have I missed any configuration step? I don't know what else to try...

I appreciate any help you can provide!







Reply all
Reply to author
Forward
0 new messages