Web Hosting Talk







View Full Version : MySQL Max Connections


Snitz
08-10-2007, 07:49 AM
Warning: mysql_connect() [function.mysql-connect]: User revoluti_copp1 has already more than 'max_user_connections' active connections in /home/revoluti/public_html/facebook/pic/index.php5 on line 68
Could not connect: User revoluti_copp1 has already more than 'max_user_connections' active connections

I'm getting this error whenever I open index.php, although I have the

mysql_close($con);

at the bottom of the code.

Here is the full code, please tell me what's wrong.

<?
$con = mysql_connect("localhost","revoluti_copp1","EncL9TK6Kynu");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("revoluti_copp1", $con);
$result = mysql_query("SELECT pid, aid, filename, pwidth, pheight FROM cpg_pictures ORDER BY pid DESC LIMIT 1");

while($row = mysql_fetch_array($result))
{ ?><a href="http://www.revolutionx.org/facegallery/albums/userpics/<? print stripslashes($row['filename']); ?>" target="_blank"><img src="http://www.revolutionx.org/facegallery/albums/userpics/thumb_<? print stripslashes($row['filename']); ?>" border="0" /></a>
<?
}
mysql_close($con);
?>

Xeentech
08-10-2007, 12:06 PM
Ask the admin what your 'max_user_connections' is set to.. It might be really low.

How busy is the site in question?

Snitz
08-10-2007, 01:00 PM
I just emailed them, I don't know how low it is set, but obviously very low.
The site isn't active at all, it's actually a test gallery for now with 4 images and less than 3 users visiting it.