**Frustrated by the lack of clear documentation for Google cloud compute engine (GCE) and integration with Google cloud SQL and especially linking the two. No live support, and current documentation lacks clarity by continuing to refer to Google App Engine. The documentation on Google App Engine references linking but no clear process for creating a link between VM Instance (in Compute Engine - GCE) and Google SQL on the same project in the Google Cloud (again both on Google Cloud).
I have installed Centos 7 VM (64) with Mariadb, MariaDB server and PHP with all connectors. I have tested all localhost call and all are working.
In Access Control on Google SQL:
Directions seem to indicate using socket and then using root for PHP application ?
- seems rather un-secure. Versus using root for admin then having app run limited permissions user in a limited database. Need different software components to have different Database and Table Access.
When establishing a user with privileges in mySQL from CLI does Access Control require the same user setup up with same settings?
When setting up SSL on Cloud SQl, should not the SSL be auto-populated to compute engine or do I need to set up the key files in compute engine as well. I have tried with this setting off (need very secure data transfer). But still no joy.
In testing PHP access I, as of yet, have NOT gotten a data call to work, even using instructions found here: Accessing Google Cloud SQL instance from Google Compute Engine?
EDIT - SOLVED - Thanks to David below and link mentioned in comment below.
Follow directions below and add following steps:
a. After user is created on Developers Console in Cloud SQL, use CLI, HEIDI, mySQL Workbench or something similar to connect to Instance and set specific database privileges by adjusting the user already created.
b. Then return to VM (GCE) instance via SSH and adjust Apache/SELinux by allowing remote mysql - see this link: php can't connect to mysql with error 13 (but command line can)
c. Install a TEST mysqli or PDO connector and check for errors.
d. Voila