mySQL Too many connections (1040)

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jessemd
New Member
New Member
Posts: 4
Joined: Wed Dec 17, 2008 6:29 am

mySQL Too many connections (1040)

Post by jessemd »

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

Return to “CMSMS Core”