Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mysqli Connection: Error exceeded the 'max_user_connections'

Warningmysqli::mysqli(): (HY000/1226): User 'gajendra' has exceeded the 'max_user_connections' resource (current value: 30)

Connection failed:- User 'gajendra' has exceeded the 'max_user_connections' resource (current value: 30) 



Please help to resolve the issue. 

You have too many scripts running at the same time. In this case 30.

That's OK. But how we can fix this issue? Please provide the solution.

You need to lower the number of your mysql connections.

I don't know what you're doing but I never needed 30.

Maybe you have looping scripts in the background. 

Try restarting the server by switching php versions back and forth in the cpanel.

If you must run 30 scripts, I suggest you upgrade.

Hi Thanks for quick response. We are not looping any mysql scripts. 


May be because of users/ visitors? What needed to be upgrade. Please suggest.

Do you know for sure how many scripts are running in the background? Are You certain?
If you have more than 30 visitors at the same moment running the same script it can happen too. If this is the case, you'll have to upgrade your plan. The best would be to contact support on chat because they can look into your account and suggest what you might need.


Edit: By the way, regular Google analytics or JS analytics scripts can't track all your visits. So if you're using that it's not going to be an exact number. 
My sites get two or three times more visits from people with disabled JS and tracking. I track them with my own tool.

Which plan we have to upgrade? Currently we are using Delux plan.

Maybe you don't have to upgrade. Contact support.

We have only 4 database in cpanel so we have used only 4 places for mysql database connections. Is any other script causing this type of issue. We needed to fix this issue asap. Please guide.

Every time a user runs a script that connects to the mysql a new connection is open. Maybe your code is opening too many connections. Restart your server first and see if it fixes it.If it doesn't contact support through chat.