Web Hosting Talk







View Full Version : a mysql connect problem


Yong
08-15-2003, 12:19 AM
Just Dedicated a server yesterday (linux redhart 8.0)
and make a website on it
but today the mysql connect is full.
someone know where i can change the mysql max connect setting?

Example
Discuz! info: Can not connect to MySQL server

User: CHOST
Time: 2003-8-15 4:09am
Script: /forumdisplay.php

Error: Too many connections
Errno.: 1040

Similar error report has beed dispatched to administrator before.


my website http://www.99bbs.com

2uantuM
08-15-2003, 02:58 AM
/etc/my.cnf

cisco_s
08-15-2003, 02:25 PM
check your scripts to see if any are leaving the connections open. What I do on my sites is on every page I include a footer.php at the end, and in that footer I check to see if a connection exists, and if so, close it.

Jakiao
08-15-2003, 06:23 PM
Yeah, check all of your scripts for anything like "persistant" connections. Those don't close automatically and just stay open even when the user leaves.

Since it is PHP, look for something like: mysql_pconnect(); Instead of the ( and ) will be host, user, password info, or variables for those.

If you do find a mysql_pconnect(); then look for a mysql_close(); ...

--connection--
$variable = mysql_pconnect(info_here);

--close--
mysql_close($variable);

If you see that, then it is fine, otherwise change the code from

mysql_pconnect(info); to mysql_connect(info);

Otherwise, do as 2uantuM said.