Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have one site hosted with godaddy on shared hosting, it was working fine but from the last 3-4 days, sometimes it shows the error while connecting to database. So I checked the errors_log. In error log I found out this error.

PHP Warning:  mysqli_connect(): (42000/1226): User 'admin' has exceeded the 'max_user_connections' resource (current value: 30) in /home/y3if63mq4u0l/public_html/classes/Database.php on line 30


So I run this query "
show global variables like '%connections%'
" to check how many connections I have available its shows me "max_connections" -> 1000 and
"max_user_connections" ->200 but in error its giving me a error on 30.

So is there anyway that I can increase the max_user_connection on shared hosting or is there any other way to solve this.

Also is there any way through which I can check, how many users are currently active and which file they are accessing. In short, I want to keep track which is taking up my resources because may be there is some problem in my coding.

Thanks,
Anchal Bhargava

What I have tried:

I contacted 'Godaddy' support they are saying me to upgrade to VPS, but actually its not my site, its my client site and he isn't ready to upgrade it to VPS or Dedicated Server.

I googled for any solution but can't find any appropriate solution.

I did manually close database connection at the end in each file
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900