Monday, July 24, 2017

[google-cloud-sql-discuss] Google Compute Engine VM connection to Google SQL Instance

Hi
I seem to have a problem configuring a config.php which basically connects my website on the VM to an SQL database on Google SQL

I also have phpMyAdmin successfully installed and can access it via <VM_IPAddress>/phpMyAdmin

In turn, i have also successfully configured phpMyAdmin so that i can log in to the localhost database and the my Google SQL database.
This part of the process i have performed successfully for both First Generation and Second Generation instances

The part which is causing me headache is the seemingly simple addition of credentials to the config.php on my Google VM instance which needs to point to the relevant database.,

I'm sure you are familiar with this format:


// The MySQL credentials
$CONF['host'] = 'localhost';
$CONF['user'] = 'user';
$CONF['pass'] = 'password';
$CONF['name'] = 'database name';


$CONF['host'] = 'localhost'; is the part that is giving me a problem - i am normally used to just having it as localhost or pointing to a specific IP address
inputting the ip adress eg  34.125.258 of the database instance does not seem to work

https://github.com/GoogleCloudPlatform/appengine-php-wordpress-starter-project/issues/65

seems to indicate 

$CONF['host'] = ':/cloudsql/project-id:region:sql-db-instance-name';
which for sake of example:
$CONF['host'] = ':/cloudsql/live-001:europe-west1:totaldata';

but this yields same result

Have i missed something?

Please assist! Getting quite frustrated by the process here and any help would be much appreciated!

Thanks in advance





--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/6de8b295-89aa-4868-9a67-10b1f8c3c2dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment