Jump to content

Error: MySQL exceeded 'max_user_connections' active connections?


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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.