Connection failed: SQLSTATE[HY000] [1226] User ‘yourdatabasename’ has exceeded the ‘max_user_connections‘ resource (current value: 25)

Will help you in giving the no of connections you have set. Increase the number of connections If its less than 25 or 30. Max connections can be more than 16000 I guess, it all depends on your cpu, no of threads It can handle etc.

has exceeded the ‘max_user_connections’ resource

If you are opening your website and you are getting the error of max_user_connections, then what can you do, how can you solve this problem?

Connection failed: SQLSTATE[HY000] [1226] User ‘yourdatabasename’ has exceeded the ‘max_user_connections‘ resource (current value: 25)

When we work on shared hosting, it is normal to have such an error, then you also get to see such an error sometimes, and the website stops for a few hours, and after a few hours it runs automatically.

why does this happen ?

One means of restricting client use of MySQL server resources is to set the global max_user_connections system variable to a nonzero value. This limits the number of simultaneous connections that can be made by any given account, but places no limits on
what a client can do once connected.

Since you are exhausting the server resources hence it is throwing the error.

and you 503
Service Unavailable
The server is temporarily busy, try again later! This error is also seen

I am assuming that your max_user_connections is set to 25. Please increase the max_user_connection value.

How to increase max_user_connection value?

By contacting the company whose hosting you are using, you can increase the max_user_connection value.

You can also solve this problem by setting some settings in hpanel/cpanel.

How to fix max_user_connection problem from Cpanel

If you have cpanel and you are getting the error “Has exceeded the ‘max_user_connections’ resource” then how can you fix this error?

Step 1:- First of all open the cPanel.

Step 2:- Search by entering MultiPHP INI Editor in Cpanel search bar

 

Step 3:- Now you have to click on MultiPHP INI Editor

Step 4:- Then you get to see this in front of you, now in “select a location” you have to select the domain on which you are getting to see this problem.

Step 5:- Now you have to increase the number in “max_execution_time” and “max_input_time“, if first it has 25, 30 etc then double it.

Step 5:- After increasing the numbers in “max_execution_time” and “max_input_time”, you have to click Apply Button.

Step 6:- After doing this much work, you refresh the website after some time, the error will be removed.

 

Apart from this, you should also clear the Cache of that website.

 

How to delete / clear Caching from cPanel ?

By clearing the caching of the website, your problem becomes solved, then you can also check by doing this

 

Step 1:- First of all open the cpanel, search in the search bar, caching, you will get the option displayed.

 

Step 2:- You get to see the option of Website Caching in cpanel

Step 3:- You get to see the option of Website Caching in cpanel

Step 4:- The domain list will appear in front of you, next to the domain on which the problem is going on, you have to click on the Purge Cache button.

Step 5:- Then you will see like this, now you have to click on Confirm Action button.

Step 6:- You will get the message of Cache Succesfulli, but it takes 30-40 minutes to complete the backup, now you have to wait for some time.

By doing this your closed website also becomes operational.

 

If you have cpanel, then you can do both these things, your website will start normally, if nothing happens even after doing this, then you can tell your hosting provider about it by chatting, your website will start immediately.

 

How to set max_user_connections in Hostinger’s hPanel ?

If you have hosting of Hostinger, then you follow the steps given below.

Step 1:- First of all you have to open your hpanel, come to Dashboard

Step 2:- Select the domain on which the problem is coming, then you have to type PHP in the search bar.

Step 3:- Then you get to see PHP Configuration option in Advance Option, you have to click on it.

 

Step 4:- Then you have to click on the PHP Options button

 

Step 5:- Now you have to increase the number in maxExecutionTIme and maxInputTime, whatever the number is, you have to double it.

Step 6:- Now you have to click on the Save Button foot

Now you can check by refreshing the website, this problem must have been solved.

Note:-

If nothing has happened even after doing this, then you can do one more thing, so far all the files that are running in the backend should be closed, they are causing problems in opening your website.

How to close redundant files/links running in backend?

If your website is not opening, then you can stop the command running in the backend, which will end the load on the website.

 

Step 1:- First of all you have to open the panel, in that you will have options displayed in the menu bar.

Step 2:- Now you have to click on the option of Resources Usage in Hosting

 

Step 3:- If you search by entering Resources Usage in the search bar, even then you get to see the option, now you have to click on it.

Step 4:- Now you have to scroll down the page and go to Stop Running Processes option.

Step 4:- As you click on this button, you get to see the Confirm button, you have to click on it.

 

 

Step 5:- You will get to see something like this in front of you, now you have to wait for some time.

Step 5:- Then you get to see this in front of you, now your work is done, you can check by visiting the website

 

With this method, you can solve this problem, if you do not get well even after doing all this, then you should chat with your hosting provider.

Leave a Reply

Your email address will not be published. Required fields are marked *