Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Connect to Google CloudSQL database using CloudSQL proxy

I have successfully installed and configured osTicket on Ubuntu using Google CloudSQL as the backend database, by specifiying the IP address of the Google CloudSQL instance during installation.

However the preferred way to connect to Google CloudSQL is to use the CloudSQL proxy which essentially creates a local socket to allow connectivity to CloudSQL. 

So rather than using a connection string such as 

 mysql -h 123.123.123.123 -u root -p

You can connect using a socket such as 

 mysql -S /cloudsql/production:europe-west1:prod-mysql-lnx -u root -p

How do I configure osTicket to use a connection string with a socket rather than defining a hostname/IP address?

Thanks

Supertommo

Comments

  • This is not a feature of osTicket at this time, and you would have to edit the core files to do that.
    My guess would be either  \include\mysqli.php  or \include\class.orm.php or both.

    Google provides a demo script here that might give you some insight:
    https://cloud.google.com/appengine/docs/php/cloud-sql/
  • I have found that if you change the way you initialise the CloudSQL proxy you can connect using 127.0.0.1 as the hostname

    If CloudSQL proxy is started using the following

    ./cloud_sql_proxy -instances=production:europe-west1:prod-mysql-lnx=tcp:3306

    You can then connect using

    mysql -h 127.0.0.1 -u root -p
  • Tell me to connect to the system will suit all type of proxies? Or it must be of high quality paid proxies? 
Sign In or Register to comment.