Tuesday, October 15, 2013

Can't connect from Compute Engine

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!







--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/a1d52c79-9eb5-4e57-bd2c-10ec93fb74f3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment