Issues connecting to Google Cloud SQL for wordpress

2,335 views
Skip to first unread message

NP

unread,
Jan 23, 2016, 10:23:26 PM1/23/16
to Google Cloud SQL discuss

I'm trying to host a wordpress blog on google app engine (GAE). I am following the steps outlined on the link below

http://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/

I have created my project, deployed it, created an SQL instance and also created a database using the steps outlined in the link above (Note: I can't see the databases directly on Google Cloud SQL but when I query it from my console, I can see it).

One of the steps in the link above says to navigate to http://.appspot.com/wp-admin/install.php

When I do that, I get the following error

Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at :/cloudsql/<PROJECT_ID>:production. This could mean your host's database server is down.

Please note that 'production' is my SQL instance name. I had earlier tried 'wordpress' as recommended in the starter-project but deleted it when i had issues and I'm unable to reuse it.

I also noticed that the Google Cloud SQl window has the following entry

Instance connection name     <PROJECT_ID>:us-central1:production

i.e. it automatically appended the location to my project id and instance name. So I tried using that in my config.php file in the place where it said to use ':/cloudsql/your-project-id:your-instance-name' but that still doesn't solve the problem.

Anybody have a solution?

Vadim Berezniker

unread,
Jan 23, 2016, 10:57:08 PM1/23/16
to Google Cloud SQL discuss
Hi,

Did you create a Second Generation instance by any chance? 
App Engine connectivity is not yet supported for Second Generation instances. 
If that's the case, please try creating a First Generation instance.
Sorry about the confusion.

--
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/a882245c-231d-4458-8ed2-94e7a47ba093%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

NP

unread,
Jan 23, 2016, 11:23:52 PM1/23/16
to Google Cloud SQL discuss
Yes, I created a second generation instance based on the steps in this article - https://cloud.google.com/sql/docs/create-instance

I will try with the First Generation Instance. Thanks for the tip.

On Saturday, January 23, 2016 at 7:57:08 PM UTC-8, Vadim Berezniker wrote:
Hi,

Did you create a Second Generation instance by any chance? 
App Engine connectivity is not yet supported for Second Generation instances. 
If that's the case, please try creating a First Generation instance.
Sorry about the confusion.

On Sat, Jan 23, 2016 at 7:23 PM NP <neara...@gmail.com> wrote:

I'm trying to host a wordpress blog on google app engine (GAE). I am following the steps outlined on the link below

http://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/

I have created my project, deployed it, created an SQL instance and also created a database using the steps outlined in the link above (Note: I can't see the databases directly on Google Cloud SQL but when I query it from my console, I can see it).

One of the steps in the link above says to navigate to http://.appspot.com/wp-admin/install.php

When I do that, I get the following error

Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at :/cloudsql/<PROJECT_ID>:production. This could mean your host's database server is down.

Please note that 'production' is my SQL instance name. I had earlier tried 'wordpress' as recommended in the starter-project but deleted it when i had issues and I'm unable to reuse it.

I also noticed that the Google Cloud SQl window has the following entry

Instance connection name     <PROJECT_ID>:us-central1:production

i.e. it automatically appended the location to my project id and instance name. So I tried using that in my config.php file in the place where it said to use ':/cloudsql/your-project-id:your-instance-name' but that still doesn't solve the problem.

Anybody have a solution?

--
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.

SS

unread,
Jan 23, 2016, 11:36:45 PM1/23/16
to Google Cloud SQL discuss
Hi Team,
               In this regard, do you all know when only we can have APP engine connectivity to Second gen Cloud Sql instance?
Its been long fr now that there is no connectivity fr the second gen instance.

BR,


On Sunday, January 24, 2016 at 11:57:08 AM UTC+8, Vadim Berezniker wrote:
Hi,

Did you create a Second Generation instance by any chance? 
App Engine connectivity is not yet supported for Second Generation instances. 
If that's the case, please try creating a First Generation instance.
Sorry about the confusion.

On Sat, Jan 23, 2016 at 7:23 PM NP <neara...@gmail.com> wrote:

I'm trying to host a wordpress blog on google app engine (GAE). I am following the steps outlined on the link below

http://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/

I have created my project, deployed it, created an SQL instance and also created a database using the steps outlined in the link above (Note: I can't see the databases directly on Google Cloud SQL but when I query it from my console, I can see it).

One of the steps in the link above says to navigate to http://.appspot.com/wp-admin/install.php

When I do that, I get the following error

Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at :/cloudsql/<PROJECT_ID>:production. This could mean your host's database server is down.

Please note that 'production' is my SQL instance name. I had earlier tried 'wordpress' as recommended in the starter-project but deleted it when i had issues and I'm unable to reuse it.

I also noticed that the Google Cloud SQl window has the following entry

Instance connection name     <PROJECT_ID>:us-central1:production

i.e. it automatically appended the location to my project id and instance name. So I tried using that in my config.php file in the place where it said to use ':/cloudsql/your-project-id:your-instance-name' but that still doesn't solve the problem.

Anybody have a solution?

--
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.

NP

unread,
Jan 24, 2016, 12:13:49 AM1/24/16
to Google Cloud SQL discuss
It worked!
wow! This already cost me a day. Thanks so much.

Now I have another problem and this is not SQl related but maybe you have a solution. I've been able to connect to the DB, and run the installation from

http://<project_id>.appspot.com/wp-admin/install.php


But after I log in, the system does not redirect me to the admin page. I just see the redirect url in the bar but the login-form still remains visible. After several tries, I tried to change my password by clicking on the forgot password and enter my password but then I get the error


The e-mail could not be sent.
Possible reason: your host may have disabled the mail() function.

Hai Xu

unread,
Feb 12, 2016, 9:49:16 AM2/12/16
to Google Cloud SQL discuss
Hi

I have the same issue when I tried to install wordpress to app engine.
And, everything local works well, and I can even deploy successfully, however, when I tried to install wordpress on app engine by
I get an error page saying 
"

Error establishing a database connection

This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at :/cloudsql/<project_id>:testsqlv1. This could mean your host's database server is down.

.....

    "

    if I try http://<project_id>.appspot.com, I get page showing:

    "

    Error establishing a database connection

    "

    I first tried second gen, and then first gen, none works for me.

    I have app.yaml modified with <project_id> at the first line of the file
    and I have wp-config.php modified with db name, db host, username password, etc.

    I use root with empty password.

    I also connect into mysql using instance IP and create database, say, 'wp_wordpress', 

    It took me a whole day, and still the error page when I tried to install wordpress on app engine.

    Can anyone help me on this issue?

    Thanks a lot in advance

    Hai

    NP

    unread,
    Feb 13, 2016, 3:08:05 PM2/13/16
    to Google Cloud SQL discuss
    Hi,

    Confirm that the name you used when you created your db (on cloud sql) is the same name you have in your wp-config.php file

    Also, confirm that you have user 'root' for your DB.

    Kathryn Beals

    unread,
    Oct 24, 2016, 9:53:07 AM10/24/16
    to Google Cloud SQL discuss
    If you're using a second-gen Cloud SQL instance, you need to include the full instance connection name (including region), e.g. your-project-name:us-central1:wordpress, as well as the root password for your Cloud SQL instance. That worked for me...

    Reuben Sterling

    unread,
    Apr 3, 2017, 8:44:50 AM4/3/17
    to Google Cloud SQL discuss
    Thank you! Adding the region and the password worked for me too. Is that described in documentation somewhere or did you figure it out? 

    Fenny Low

    unread,
    Oct 11, 2017, 9:03:19 AM10/11/17
    to Google Cloud SQL discuss
    Everything is correct in my wp-config with sql instance, db details and all. Still getting the 

    Error establishing a database connection 

    when accessing from web browser. 
    No error access cloud_sql_proxy with authentication.

    Please help :(
    Thank you.

    NP

    unread,
    Oct 18, 2017, 7:33:51 PM10/18/17
    to Google Cloud SQL discuss
    Are you using a Second Gen or First Generation instance? If second generation, try the response from Kathryn Beals

    Ishwara Bhat

    unread,
    Jan 31, 2018, 9:15:31 AM1/31/18
    to Google Cloud SQL discuss
    Please let me know if this is resolved. Me too facing the same issue. 
    Reply all
    Reply to author
    Forward
    0 new messages