CodeIgniter Forums
codeigniter database connection to google cloud SQL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: codeigniter database connection to google cloud SQL (/showthread.php?tid=67037)



codeigniter database connection to google cloud SQL - aminfow01 - 01-05-2017

  I am unable to connect the codeigniter application to google cloud SQL, i need some help step n 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
);



RE: codeigniter database connection to google cloud SQL - Diederik - 01-06-2017

Your hostname seems invalid.


RE: codeigniter database connection to google cloud SQL - eagle00789 - 01-11-2017

you need a google cloud sql proxy which is explained in detail on cloud.google.com

can you show us how you start the sql proxy? (the complete command)