Database connection Error

28 views
Skip to first unread message

Bhanu Teja

unread,
Oct 18, 2018, 9:08:45 AM10/18/18
to Google Cloud SQL discuss
Hi,

I am new to google cloud server.

I am getting database error in my codeigniter frame work (PHP) application.

Database: Mysqli
Application version: PHP 5.5

Error Message: Unable to connnect your database by provided settings.

My sample database config code:

$db['default'] = array(
'dsn' => "'',
'hostname' => ' cloudsql/INSTANCE_CONNECTION_NAME;dbname=DATABASE ',
'username' => 'db user',
'password' => "db Password'',
'database' => 'db name',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => TRUE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '{PRE}',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);

Please help me on this.

George (Cloud Platform Support)

unread,
Oct 18, 2018, 12:43:50 PM10/18/18
to Google Cloud SQL discuss
Hello Bhanuteja, 

Connection setup from CodeIgniter is more involving; you may refer generally to "Database Configuration" page. For a practical guide and helpful example, you may check the up-voted reply to the "How do I connect to a Google Cloud SQL database using CodeIgniter?" question in stackoverflow. 

This discussion group is oriented more towards general opinions, trends, and issues of general nature touching the app engine. For coding and database connection issues, you may be better served in dedicated forums such as stackoverflow, where experienced programmers are within reach and ready to help. 
Reply all
Reply to author
Forward
0 new messages