View Full Version : Warning: mysql_connect():
Duilen
06-10-2005, 08:31 AM
I am getting the following error any idea why?
Warning: mysql_connect(): User * has already more than 'max_user_connections' active connections in /home/blogtra/public_html/libs/adodb/drivers/adodb-mysql.inc.php on line 346
I was adding categories through the admin panel when I got this error now it wont let me connect to the DB. (if that helps)
David
06-10-2005, 08:39 AM
Well, cdb is the better person answer this one, but I can tell you one fix.
If you have access to the server, just restart mysql. This may also clear itself up in a few minutes as the connections are closed. I will definitely make sure cdb takes a look at this. Do you have any other applications that are using mysql?
Duilen
06-10-2005, 08:43 AM
Ok, It is working now. I don't have anything else running on MySQL.
Duilen
06-10-2005, 08:50 AM
Everything seems to be working now but when I try to add additional categories the same error pops up then I have to wait for the connections to close. I'm pretty sure I can't reset mysql it through my cpanel...
David
06-10-2005, 08:54 AM
Ok, this sounds quite fixable, but I think cdb will have the best answer.
Sorry for the inconvenience, and we certainly appreciate your continuing feedback. Hopefully, soon we will move past RC2 and call it official. :D
The problem is caused by the fact that persistent database connections are used.
After doing I bit of reseach I decided that I'll give up using persistent connections.
I used persistent connections mainly for PostgreSQL where the connection overhead is big.
Most probably there will be an RC3 in the next 24 hours
kwirl
06-10-2005, 06:24 PM
rc3????/ arghfarfignewtons
David
06-10-2005, 06:46 PM
Content visible to registered users only.
:lol: :lol: :lol:
I have already asked that a zip with ONLY the changed files be released, so it should be a peice of cake....just upload a couple of files and overwrite.
Duilen
06-11-2005, 12:10 AM
With persistent connections shouldn't each query be running off the previously opened connection? If that is the case I shouldn't be getting an error for opening too many connections for the same task.
I did a little research on this and it seems that apache opens a new connection for each query even if there is a persistent connection open. If that is the case then I should add tags to close all connections after they are used right? Is that what you are doing with rc3 or is there another problem?
Yes, that's the problem, but closing a permanent connection has no effect. So there are only 2 solutions: either increase the maximum permanent connections to a number higher than the number of Apache child processes, or switch to normal connections.
If you can't wait for RC3 simply look for PConnect in the code and replace it with Connect, that's what I'm going to do anyway :D
Duilen
06-11-2005, 01:22 AM
ok thanks, this will take about 2 minutes with DWs find and replace function :)
Duilen
06-11-2005, 01:28 AM
Seems to work fine now. Ill tell you if I run into any problems.
Duilen
06-11-2005, 04:09 AM
I just got the same error with connect instead of pconnect...i guess the connections aren't automatically closing like they should be. I had mysql reset and I have added mysql_close(); to the end of the file to manually close connections. I am now testing...
From what I know that is not normally possible since PHP automatically closes any opened connection when the script execution ends.
From the PHP manual:
Content visible to registered users only.
Are you sure you replaced both PConnect references? there is one in /init.php and one in /admin/init.php
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.