• User xxxx already has more than 'max_user_connections' active connectionsError establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at localhost could not be established. This could mean your host’s database server is down.

    • Are you sure you have the correct username and password?
    • Are you sure you have typed the correct hostname?
    • Are you sure the database server is running?

    this error happened while trying to activate a plugin

    note : i cant access the front nor the backend of the site , sometimes i can access it and the site works properly just for a few seconds

Viewing 3 replies - 1 through 3 (of 3 total)
  • User xxxx already has more than ‘max_user_connections’ active connections

    The max_user_connections limit is from your database server’s configuration.

    Contact your hosting provider if you have no clue what this is.

    Thread Starter nidalzeineldine

    (@nidalzeineldine)

    So there’s nothing to do with the plugins and the site’s backend?

    Maybe, maybe not.

    Let’s first try to understand the problem.

    As I mentioned earlier, your site is hitting a resource limit imposed by your hosting provider. This is similar to your site using up all the amount of space provided by your host.

    What would you do if you were to use up all your hosting space? While this will affect the performance of your site, it’s not a problem created by WordPress by itself, and WordPress cannot fix it.

    You could ask your hosting provider to increase the space. But this will almost invariably involve upgrading your hosting plan (and paying more). As max_user_connections is just another resource allocation, a similar scenario will play out if you contact your host.

    Of course, switch to a different hosting provider that provides more resources (disk space, max database connections, etc) at your current budget.

    The second way you could address the “no space left” problem would be to audit your site to see if you can free up some space. Perhaps there’s a huge error.log file that you can safely delete. Perhaps you have some old backup files you can delete. Some people even decide to “prune” out old posts and images — just to free up more space, so they don’t have to upgrade their hosting plan and pay more or change hosts. The goal here is to bring the resource usage — disk space in this case — down below the limit imposed by the host.

    But sometimes, despite all the prunning, you may simply not have anything more to throw away — and your only solution left is to either upgrade your hosting plan at your current host, or switch to another provider that offers more storage at your current budget.

    In the case of exceeding the maximum database connection limit, you first want to know what that limit is. Then you could monitor your database queries to know what’s going on behind the scenes. Is something (WordPress, a plugin, your active theme) opening connections and not closing them properly? Is some query taking too long to complete?

    You could use the Query Monitor plugin to dig into this. But note that this is very technical and even if you manage to find some long-running processes using up all your allowed database connections, you may not be able to do anything to fix the problem (besides ditching the responsible plugin).

    Also, note that if you have a very active site and you’re not doing any caching, you can easily hit your database connections limit — by the sheer number of users making requests to the site (even when there’s no underlying problem.)

    For most people who have caching already and still hitting this resource limit, increasing the connection limit (via hosting plan upgrade or switching to another host) is the only viable option.

    (NB: The above assumes you’re on a shared hosting plan. If you run your own server, you can easily increase the max_user_connections value in your MySQL configuration file.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘User xxxx already has more than ‘max_user_connections’ active’ is closed to new replies.