failure to connect to Google SQL First gen (and Second gen?) -


i receiving error when trying load webpage

failed connect mysql: (2005) unknown mysql server host ':/cloudsql/testsite:europe-west1:testdatabase' (2)error: 

i have google compute engine vm set lamp stack (apache/2.4.10 (debian)/ database client version: libmysql - 5.5.55 / php extension: mysqli)

i have set instance on google sql user credentials aforementioned vm (i have set both first gen , second gen)

i can access both local mysql database on vm google sql databases via phpadmin installed locally

however appear have issue db_host credentials in config.php file when run script path = /var/www/html/includes/config.php

i

usually local mysql databases use

// mysql credentials $conf['host'] = 'localhost'; $conf['user'] = 'yourdbuser'; $conf['pass'] = 'yourdbpass'; $conf['name'] = 'yourdbname'; 

documentation (and github links) recommend path

:/cloudsql/project-id:region:sql-db-instance-name 

which have done (see above) - keep getting error message.

am typing host description incorrectly? or have missed configuration step?

thanks in advance

it seems if have erred , credentials format stated earlier google app engine

if on google compute engine, have 2 options:

  1. connect public ip address of cloud sql instance. requires whitelist gce instance on acl cloud sql instance.
  2. use cloud sql proxy. daemon run on gce instance allows connect via tcp on localhost or socket.

Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -