Friday, September 25, 2015

Re: [google-cloud-sql-discuss] my php script is working fine in GAE but not on the server

Hi,

As documented, when connecting from Google App Engine to Google Cloud SQL you should not connect by IP, instead you should connect to a socket at /cloudsql/<your-project-id>:<your-instance-name> (normally with username 'root' and blank password).

Yours,
David

On Fri, Sep 25, 2015 at 2:21 PM, help <surveyofca@gmail.com> wrote:
my php script is working fine in GAE but not on the server. If i run this script on my computer it is working fine , cloud sql database is also updated but this script is not working on cloud. Show error :- Could not get data: Unable to find the socket transport "unix" - did you forget to enable it when you configured PHP?







script is as follow :-


<?php
   
$conn = mysql_connect('173.194.249.431',
  'anurag', // username
  'sdsdsZcz'      // password
  );
if ($conn)
{
echo "connection established";
}
$checkdb = mysql_select_db('test');
if ($conn)
{
echo "database connected";
}
$sql = "INSERT INTO test (name) VALUES (123)";
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
  die('Could not get data: ' . mysql_error());
}
echo "successfully done ";
?>

--
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/d1eeea7b-8816-4ea0-9fbf-615b125adc8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAJZK_bYJS%2BfhWsGLOgL%3DeGP1tTLQx0sQXWNxTzyLF3dRBUzOTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment