Search code examples
phpmysqlwordpressgoogle-app-enginegoogle-cloud-sql

Error establishing a database connection: Google App Engine Deploy


I am running 2nd generation instance. I am able to connect locally but when I run gcloud app deploy I keep getting the error Error establishing a database connection I have tried using root and a blank password and still does not work.

I have followed instructions from https://cloud.google.com/php/tutorials/wordpress-app-engine-flexible and still getting the error.

See my wp-config.php page as well as the screenshot from cloud.google.com everything matches but still getting the error.

Local Connection of SQL Working

My Instance

My Users

wp-config.phpSQL Instance


Solution

  • I have followed the [tutorial](https://cloud.google.com/php/tutorials/wordpress-app-engine-flexible ) you mentioned and got the same issue. When I followed instructions on GitHub of the sample it works as expected.

    An important difference I found is that the official tutorial doesn't mention cron.yaml:

    gcloud app deploy
    

    and in the repo:

    gcloud app deploy \
        --promote --stop-previous-version app.yaml cron.yaml
    

    I would follow the github version only.