0
votes

Ive tried and tried to get this to work to no avail.

I have WordPress running on Google Computer Engine, and I have my database on Google CloudSQL. Both are in the same project, and I have managed to connect to MySQL via the CloudSQL Proxy with:

./cloud_sql_proxy -dir=/cloudsql -instances=[CLOUDSQL INSTANCE CONNECTION] & mysql -u [CLOUDSQL USER] -S /cloudsql/[CLOUDSQL INSTANCE CONNECTION]

This brings up the mysql command where I can show my databases in that remote connection.

I am not sure if I need to put something in my wp-config.php file to pick up on the CloudSQL Database or what.

I already have the scope set to allow CloudSQL access, and I am able to actually connect from GCE over to the CloudSQL DB, but I am not sure how to get wordpress to access the DB.

I saw this here: Connecting Google Cloud SQL with Wordpress on Google Compute Engine But it didn't help me because I wasn't sure exactly what needed to be done.

I would be EXTREMELY greatful for any help.

1

1 Answers

0
votes

Although you use Google Compute Engine instead of Google App Engine to host your WordPress, the configuration "wp-config.php" should be very similar to the code in https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project/blob/master/wp-config.php as described in http://googlecloudplatform.github.io/appengine-php-wordpress-starter-project/. You should set DB_HOST to ":/cloudsql/[CLOUDSQL INSTANCE CONNECTION]".