-1

Some time I am facing database connection issue in live website and I am using codeigniter framework.My database connection is here

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

$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'infomagi_user';
$db['default']['password'] = 'Sdf!23!@#$5';
$db['default']['database'] = 'infomagi_infodb';
$db['default']['dbdriver'] = 'mysqli';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = FALSE;
$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;

please find the problem and what changes does it above database connections

sachu
  • 3
  • 1
  • 7
  • 1
    Please post your error message. – NikuNj Rathod Jan 12 '18 at 10:22
  • unable to connect to your database server using the provided settings. filename core/loader.php Line Number:347 – sachu Jan 12 '18 at 10:26
  • Possible duplicate of [CodeIgniter: Unable to connect to your database server using the provided settings Error Message](https://stackoverflow.com/questions/7254049/codeigniter-unable-to-connect-to-your-database-server-using-the-provided-settin) – Ravi Sachaniya Jan 12 '18 at 10:31
  • I don't understand what you are mentioning,I think the error message is shown when traffic of the website is high so what I do for resolving this issue – sachu Jan 12 '18 at 10:43
  • The 'hostname' of the live server probably isn't 'localhost'. – DFriend Jan 12 '18 at 14:58

1 Answers1

0

If this is only happening sometimes, it could very well be the webserver, not your configurations. Another possibility is that your database server might be configured to limit the number of active connections as you mentioned that it happens when traffic is heavy

Megan
  • 474
  • 1
  • 5
  • 11