user3114211
user3114211

Reputation: 1

Cannot connect to cloud SQL [SQLSTATE[HY000] [2002] No such file or directory]

I have set up 2 projects in my Google Cloud console. The following are the two projects that I have set up in my console. 1. Cloud SQL + App Engine 2. App Engine (New)

So the idea is App Engine (1) is running the same database as App Engine (2). I have already set up the IAM Permission Page and IAM Admin and Project Page.

I have given both projects as Project Editor role too, but still my (2) still can't connect to my (1) database.

Any help please?

Upvotes: 0

Views: 2847

Answers (1)

George
George

Reputation: 1516

Granting access to an application does not automatically enable a database user account to connect to the instance. You may connect through a proxy, in which case you should follow these steps:

  1. Enable the API
  2. Install the proxy client on your local machine
  3. Determine how you will authenticate the proxy
  4. If required by your authentication method, create a service account
  5. Determine how you will specify your instances for the proxy
  6. Start the proxy
  7. Update your application to connect to Cloud SQL using the proxy

You can find related details on the Connecting to Cloud SQL from External Applications. This documents provides steps that cover configuring access for IP connections as well. If you connect from within the app engine environment, you may have a look at Connecting from App Engine.

Upvotes: 2

Related Questions