Jump to content

Error: MySQL exceeded 'max_user_connections' active connections?


Some Poster55

Recommended Posts

Hi,

 

Have a bit of an issue here and would appreciate some advice.

 

Occasionally I'll get this error message on my site:

PHP Notice: in file /runetrack/configure.php on line 2: mysql_connect() [function.mysql-connect]: User dbname already has more than 'max_user_connections' active connections

User dbname already has more than 'max_user_connections' active connections

 

Some days my site will be completely fine, but every so often for around ~20 minutes it will simply display the above error. I've searched around quite a bit for solutions, but was unable to locate any. Here's my phpinfo() page if that helps: http://runetrack.com/phpinfo.php

 

Any ideas as to how to solve this or even what it could be caused by?

 

Many thanks in advance! :)

No, I don't believe so.

 

I always connect to the database using mysql_connect(), and never mysql_pconnect(), if that's what makes a persistent connection. Checking my phpinfo() file, the mysql.allow_persistent directive is set to "Off" as well (I turned it off via the PHP INI file a while ago just to be safe).

Correct, I have a file called "configure.php" which only has this in it:

<?php

mysql_connect("localhost","database","password") or die(mysql_error());

mysql_select_db("dbname") or die(mysql_error());

?>

 

I then put:

include "configure.php";

At the top of all my scripts.

 

I've also heard some people saying to always use mysql_close() at the end of my script, but as I thought MySQL connections closed when a page loads, this shouldn't be necessary?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.