PHP app (on GAE) can't connect to Cloud SQL instance ("Unable to find the socket transport "unix"...)

2,718 views
Skip to first unread message

Elizabeth Stinson

unread,
Oct 1, 2013, 3:27:45 PM10/1/13
to google-cloud...@googlegroups.com
Hi,

I just created a Cloud SQL instance with the following ID: sandylizapp:userdata

I am trying to connect to that instance from my PHP app running on GAE using the following code:

$conn = mysql_connect($instance, $user, $pass);

And I'm getting the following error:

PHP Warning: mysqli::mysqli(): (HY000/2002): Unable to find the socket transport "unix" - did you forget to enable it when you configured PHP? in /ba 

Any help please? Is there a change to my PHP.INI that I need?

I thought this was the approved way of persistently storing data from a PHP GAE app.

Thanks.
Liz

Rob Clevenger

unread,
Oct 1, 2013, 3:39:30 PM10/1/13
to google-cloud...@googlegroups.com
Hi,

That doesn't look like the right format for the calls to mysql_connect.


Hope that helps,

Rob


--
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-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/7d7866e8-649c-406b-994d-f26117b45f8a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Elizabeth Stinson

unread,
Oct 1, 2013, 3:48:49 PM10/1/13
to google-cloud...@googlegroups.com
Thanks, Rob. I had noticed that and fixed it and am now getting a new error.

My project ID is:  sandylizapp
My instance ID is: sandylizapp:userdata

Fixed code (I am trying 2 out of the 3 possible ways):

        $conn = mysql_connect(":/cloudsql/sandylizapp:userdata", $user, $pass);

        $sql = new mysqli(null, $user, $pass, null, null, "/cloudsql/sandylizapp:userdata");


And now I'm getting the same error for both:

PHP Warning: mysql_connect(): Access denied for user 'l...@lizstinson.com'@'localhost' (using password: YES) in /base/data/home/apps/s~sandylizapp/1.3

 The username and password are definitely right...

Thank you so much.

On Tuesday, October 1, 2013 12:39:30 PM UTC-7, Rob wrote:
Hi,

That doesn't look like the right format for the calls to mysql_connect.


Hope that helps,

Rob
---------- Forwarded message ----------
From: Elizabeth Stinson <l...@lizstinson.com>
Date: Tue, Oct 1, 2013 at 12:27 PM
Subject: PHP app (on GAE) can't connect to Cloud SQL instance ("Unable to find the socket transport "unix"...)
To: google-cloud...@googlegroups.com


Hi,

I just created a Cloud SQL instance with the following ID: sandylizapp:userdata

I am trying to connect to that instance from my PHP app running on GAE using the following code:

$conn = mysql_connect($instance, $user, $pass);

And I'm getting the following error:

PHP Warning: mysqli::mysqli(): (HY000/2002): Unable to find the socket transport "unix" - did you forget to enable it when you configured PHP? in /ba 

Any help please? Is there a change to my PHP.INI that I need?

I thought this was the approved way of persistently storing data from a PHP GAE app.

Thanks.
Liz

--
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+unsub...@googlegroups.com.

Rob Clevenger

unread,
Oct 1, 2013, 3:51:18 PM10/1/13
to google-cloud...@googlegroups.com

On Tue, Oct 1, 2013 at 12:48 PM, Elizabeth Stinson <l...@lizstinson.com> wrote:
 The username and password are definitely right...

I'm not sure, one thing to try..

Double check the user *and* the host in the mysql.users table.  The host here is localhost for now (may change in the future) Id' use '%' for the host for now.

Rob
Message has been deleted
Message has been deleted

Abhishek Pandey

unread,
Oct 10, 2013, 8:41:07 AM10/10/13
to google-cloud...@googlegroups.com
I have the same error. Can you guys help?

Rob Clevenger

unread,
Oct 10, 2013, 9:48:52 AM10/10/13
to google-cloud...@googlegroups.com
Remember the username/password here is not your google account, but mysql database user (i.e. root with no password is the default)  I'd change that though.

Rob


--
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-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/13d5708b-0d44-41a5-9025-bee86c13e154%40googlegroups.com.

Nui

unread,
Nov 8, 2013, 10:05:55 AM11/8/13
to google-cloud...@googlegroups.com
I have the same problem too.

@'localhost' (using password: YES)

but when I check at my mysql.user table 
the host is '%'  What should I do ? 

เมื่อ วันพุธที่ 2 ตุลาคม ค.ศ. 2013, 2 นาฬิกา 51 นาที 18 วินาที UTC+7, Rob เขียนว่า:

Abhishek Pandey

unread,
Nov 8, 2013, 10:12:34 AM11/8/13
to google-cloud...@googlegroups.com

Hi Nui. This error was a Google error. Once they updated the Google App Engine launcher, my problem was solved. Check and see if you have the updated the Google App Engine Launcher to the latest version! I hope it helps.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-cloud-sql-discuss/9kfBNYbABuM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-cloud-sql-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/b9b2504e-2914-400f-acf1-b4e35617d090%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages