Welcome Guest, Not a member yet? Register   Sign In
codeigniter database connection to google cloud SQL
#1

  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
);
Reply
#2

Your hostname seems invalid.
Reply
#3

(This post was last modified: 01-11-2017, 03:22 PM by eagle00789.)

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)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB