CodeIgniter Forums

Full Version: codeigniter database connection to google cloud SQL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
  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
);
Your hostname seems invalid.
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)