all of a sudden I started to get the following message when attempting to access my site:

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

I haven't made any changes to the site or anything.

can anyone give me insight as to what is causing this, and how to solve it?

thanks

Comments

Poolio’s picture

I'm happy to report that mathias was able to solve the problem for me.

he rocks!

Put your money where your mouth is!

kbahey’s picture

It would be best to share the solution here, because six months from now, someone will face the same problem and do a search, then if they can find the answer, they do not have to ask the same question again.
--
Consulting: 2bits.com
Personal: Baheyeldin.com

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

Poolio’s picture

but I don 't know exactly what it is that mathias did, and I'd probably ending up posting wrong info if I were to try and relate what he told me.

Put your money where your mouth is!

stretchwickster’s picture

Is it possible to find out what Mathias did, as a number of people have experienced this problem and would love to know how to fix it (myself included!)?

peter_n’s picture

You were right - I have the same problem. Hmm, I'll keep searching.

jochenh’s picture

I am using an old site (4.6.3?) which had been working perfectly for months when suddenly I kept getting these max_connection errors and now it's just a total headache to the point where I can't even access the site to perform an upgrade to 4.6.9. My hostings tech support of course say it's nothing to do with their server and that its a problem with my site. I just dont understand how, since it has been running perfectly fine for so long... Anyway since there is no real solution in the forums here I will keep looking and post back to this if I end up resolving this...
Apparently the system has all of a sudden changed its own workings to no longer close persistent connections but to keep opening them until it hits the max_allowed and then the site just goes down... not sure what could have caused this but that seems to be what the hosting tech support people think is happening...

-------

http://quilted.org
http://jochenhartmann.com

PAAHCweb’s picture

then it may have had an automatic upgrade to the latest version of MySQL, 4.1.21. 4.1.21 has another bug that affects the order of posts. Not sure if there's any connection to your problem. Apparently MySQL has issued a patch for the other bug, it couldn't hurt to ask if your host has applied it.

Cheers,
D. Lynn

jochenh’s picture

Thanks for the info. My host is indeed using mysql 4.1.21. A detailed description of the bug is here

At this point I backed up all my files and installed 4.6.9 on the server. In addition I also backed up and re-created my database along with new users etc.

So when I tried to log-in to my new installation I immediately got the same mySQL error which is:

[25-Aug-2006 09:58:01] PHP Warning:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: 
User 'my-username' has already more than 'max_user_connections' active connections in /home/bfiorg/public_html/includes/database.mysql.inc on line 31


I am not sure how this could happen so quickly but it is making me think that this is not really a problem with drupal but instead with something on the server. My hosting providers tech support of course think otherwise and keep saying that I need to find a new CMS and that this is not their problem....

Soooooo I am basically stuck right now. I am signing up for a different hosting provider and hope to get my site back up within the next few days.

Any other advice of course would be much appreciated since I am sort of running out of options...

Thanks!
- Jochen

-------
http://quilted.org
http://jochenhartmann.com

jochenh’s picture

Not sure what happened but my site is now back up. I ended up going into the system table using phpMyAdmin and disabling all the unneccessary modules. I also blocked all bots from accessing the site and added some 'bad-bot' blocking rewrites in .htaccess... Since my hosting provider (site5) doesnt really like to inform me of what is going on on their end, I am not sure what happened... according to a recent email they have 'removed a firewall entry blocking your site from connecting back to it's self'... not sure why that was there in the first place ...

Well everything is working again, now my next steps are to find a better hosting provider. All I can say is that if you are planning to run a drupal site that has more than 100+ users I would not recommend site5 for this based on my experience.

- Jochen

-------
http://quilted.org
http://jochenhartmann.com

jochenh’s picture

One more thing: I also made a change to database.mysql.inc, something that is definitely a hack, something that I should probably look for a better solution to. I did change the connection mechanism on line 31 to not use persistent connections. My code now reads

 $connection = mysql_connect($url['host'], $url['user'], $url['pass'], FALSE) or die(mysql_error());
  mysql_select_db(substr($url['path'], 1), $connection) or die('unable to select database');

This was based on a posting on drupal.org -> node/80556

-------
http://quilted.org
http://jochenhartmann.com

PAAHCweb’s picture

I hope one of the Drupal cognoscenti will respond to that post, especially if it's a bad idea for some reason.

Glad your site came back.

stretchwickster’s picture

Jochen1981, what did you do to block all bots from accessing your site? My host is site5 and I've just starting getting this problem today.

ghasp’s picture

I am also having site5 problems. Glad to know it isn't just me.

gtoddv’s picture

You need to turn off persistent connections in your php.ini file. I have the same problem at site5 and it seems to coincide with the upgrade to mySQL 4.1.21. See here:

http://drupal.org/node/42626

jochenh’s picture

hey sorry it took so long to reply, i havent been checking my posts. just make a robots.txt file and deny them all access !

-------
http://quilted.org
http://jochenhartmann.com