mySQL Too many connections (1040)
Posted: Tue Feb 10, 2009 2:20 pm
Hi. I made my first site with CMSMS and about every week or so we get:
Database Connection Failed
Error: Too many connections (1040)
After reading some forum posts, I tried setting the config file to $config['persistent_db_conn'] = true; to see if that helps.
I also checked the open connections through mySQL using: show status like '%onn%';
Variable_name Value
Aborted_connects 3925
Connections 165863
Max_used_connections 18
Threads_connected 4
Are these values normal or is something wrong? Any help you can offer would be great. Thanks so much.
In another post (from 2006) I saw Ted recommended to add the following to the index.php:
if (isset($gCms->db))
{ $db =& $gCms->db;
if ($db->IsConnected())
$db->Close();
}
Will this help or is this outdated?
Thanks so much.
Jesse
Database Connection Failed
Error: Too many connections (1040)
After reading some forum posts, I tried setting the config file to $config['persistent_db_conn'] = true; to see if that helps.
I also checked the open connections through mySQL using: show status like '%onn%';
Variable_name Value
Aborted_connects 3925
Connections 165863
Max_used_connections 18
Threads_connected 4
Are these values normal or is something wrong? Any help you can offer would be great. Thanks so much.
In another post (from 2006) I saw Ted recommended to add the following to the index.php:
if (isset($gCms->db))
{ $db =& $gCms->db;
if ($db->IsConnected())
$db->Close();
}
Will this help or is this outdated?
Thanks so much.
Jesse