CodeIgniter Forums

Full Version: core/Loader can't connect to database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hi all.

I'm moving some web sites developed with CI to a new server and I have a strange issue. The default host on my server works as expected but all other virtual hosts generate this error:

A Database Error Occurred

Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 224

The config/database.php settings are identical for all the sites in question:

$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'user';
$db['default']['password'] = 'pass';
$db['default']['database'] = 'db';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

Is this an httpd.conf setting somewhere? Thanks for any pointers.

El Forum

Check and get confirmed these parameters are correct or not, what value you have set for new server:
$db[‘default’][‘hostname’] = ‘localhost’;
$db[‘default’][‘username’] = ‘user’;
$db[‘default’][‘password’] = ‘pass’;
$db[‘default’][‘database’] = ‘db’;