0
votes

My App is hosted in google app engine flex environment and i have a database which hosted in cloud sql (Mysql) 2nd generation instance. but both are different project . I given the permission also.

I am getting "SQLSTATE[HY000] [2002] No such file or directory" error

Can any one help me ?

Thanks, Subash

1

1 Answers

-1
votes

Assuming your app is written in PHP: to connect to a Cloud SQL instance one uses a Unix socket and an extension such as mysql and mysqli, both enabled by default in the PHP runtime for App Engine. You can find here a good example of connecting using mysqli_connect. The attention in this case has to be focused on the use of the socket argument in the mysqli_connect() call.

The PHP team generally recommends using PDO or mysqli, not the original mysql.

More detail is needed to set the basis of an effective investigation in your issue. Any information you deem relevant might prove invaluable.

One can use a PDO object only after creating it with a "new" statement.