I've been getting this error on my site:

Warning: mysql_connect(): User peter_n_drupaluser has already more than 'max_user_connections' active connections in /home/peter_n/public_html/includes/database.mysql.inc on line 31
User peter_n_drupaluser has already more than 'max_user_connections' active connections

I have searched the forums, but not found any answers. The site does not seem overloaded (far from it) and a suggestion to check the mysql settings with phpinfo look reasonable to me:

Directive			Local Value	Master Value
mysql.allow_persistent		Off		Off
mysql.connect_timeout		60		60
mysql.max_links			100		100
mysql.max_persistent		10		10
mysql.trace_mode		Off		Off

This could well be a shared hosting issue, so I've logged a support ticket (I will report back on that).

One thought I had was that running cron.php was taking up connections, but that doesn't seem likely as I run it once an hour.

Any suggestions would be gratefully received.

Comments

peter_n’s picture

For what its worth, this is what my hosting support person said:

Try going into the Mysql section of cPanel and checking and fixing the Databases for the accounts that are not working, this should clear out the old connections and get them working again.

I haven't done that because it is now working anyway, but I suspect it is because the server was restarted due to a different problem. So in summary, if you have this problem, it could well be to do with something in your hosting environment, rather than a drupal issue, but I don't have enough information to say one way or another.