how to connect codeigniter application to google cloud SQL

1,950 views
Skip to first unread message

Dinesh Kumar

unread,
Jan 5, 2017, 9:27:38 AM1/5/17
to Google App Engine
Hi,
       I am unable to connect the codeigniter application to google cloud SQL, i need some step or videos link for it. 

My code is : 


db['default'] = array(
'dsn' => '',
'hostname' => ':/cloudsql/test-001:europe-west1:test-001-location-data',
'username' => 'root',
'password' => 'dev',
'database' => 'devapp_test',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);

Nicholas (Google Cloud Support)

unread,
Jan 6, 2017, 2:58:42 PM1/6/17
to Google App Engine
Hey Dinesh,

While there are no Google official tutorials on the documentation site, Setup CodeIgniter on Google App Engine seems appropriate.  It explains how using CodeIgniter on App Engine with Cloud SQL differs from generic CodeIgniter with MySQL.  It also mentions specific configurations required for successful connections to a Cloud SQL instance.

Given the above code you've provided, there's not enough information to know what's actually happening.  If you encounter specific errors when running this code, I would suggest posting your code and errors on Stack Overflow as it is a better forum for error/code troubleshooting.  We monitor the google-app-engine tag.

Hope the above is helpful,
Nicholas

Nicholas (Google Cloud Support)

unread,
Jan 18, 2017, 9:12:45 AM1/18/17
to Google App Engine
If posting your code to Stack Overflow, be sure to include the following to ensure your question is effectively treated:
  • Error message you're seeing or receiving
  • Code you are using that is causing this error
  • Dependencies required for your code sample to be used
  • Relevant documentation showing why the code you are using should work
  • Description of what you are trying to achieve with this code
Hope this helps!

Pablo Castro López

unread,
Feb 24, 2017, 12:21:56 PM2/24/17
to Google App Engine
Hi, did you connect ci with google cloud?

Bharath

unread,
May 16, 2017, 9:17:32 AM5/16/17
to Google App Engine
Hello All,

I have a codeigniter application running in xampp apache in my local. I have my database in the cloud sql mysql instance. What are the configurations to be done to connect my codeigniter app to Google cloud mysql instance..

Thank you,
Bharath

Bhanu Teja

unread,
Nov 5, 2018, 8:38:54 AM11/5/18
to Google App Engine
Hello Bharath,

have you got the solution for this?

Katayoon (Cloud Platform Support)

unread,
Nov 5, 2018, 8:59:46 PM11/5/18
to Google App Engine
Hi, 

This thread also shows how to connect a CodeIgniter application to a Cloud SQL instance, however you may post your full detailed question to Stack Overflow for further technical assistance since Google Groups are reserved for general Google Cloud Platform-end product discussions and not for technical questions. 
Reply all
Reply to author
Forward
0 new messages