Wordpress Database Connection Error

I may have missed the whole issue.

OP clearly states that his site works fine until more than a specific number of users land up on his site, which is when he gets the DB error. So how would you "recommend" checking his wp-config.php? Seriously?
 
Check the logfiles and find out where and why it goes wrong.
It maybe time to tweak your MySql, increase number of simultaneous connections, increase memory usage, increase buffers, change (if you haven't already) to InnoDB, replace Mysql with MariaDB or Percona server (assuming your running linux on VPS). You can install Apache mod_cache plugin to get the pressure off of your database, but as said, first thing is to check the logs!
 
OP, the issue is most likely caused by Jetpack. Are you using the share function? And trying to add more social accounts when you encounter this error?
 
OP clearly states that his site works fine until more than a specific number of users land up on his site, which is when he gets the DB error. So how would you "recommend" checking his wp-config.php? Seriously?

Well, you don't have to be mean about it. I was just trying to help. If I can't figure it out, I check everything. That's just me though. A simple, "I don't think that's it," would've been sufficient enough.
 
Well, you don't have to be mean about it. I was just trying to help. If I can't figure it out, I check everything. That's just me though. A simple, "I don't think that's it," would've been sufficient enough.

I wouldn't call that being mean. I was simply stating that you commented without reading the while post.
 
does share button hamper database?

Yes potentially because Jetpack consumes a lot of system resources. Apart from that Publicze has 15 social account limitation, once you hit that limit you cannot add more accounts and you will see the db error.
 
I think it's your Mysql (database) service crashed due to insufficient memory. You might need to optimize the Mysql configuration to consume less resources or increase the RAM of your server.
 
I think it's your Mysql (database) service crashed due to insufficient memory. You might need to optimize the Mysql configuration to consume less resources or increase the RAM of your server.

Good advice. By default some hosting provider limit the memory to 64MB.Try asking your hosting provider to increase to 128 and see if it helps.
 
Now contact your hosting company and tell us what type of problems are you facing.
 
I think it's your Mysql (database) service crashed due to insufficient memory. You might need to optimize the Mysql configuration to consume less resources or increase the RAM of your server.
This. I have some sites running on a vps as well, you should really optimize the configuration of the mysql database, maybe switch to Mariadb as well. And I solved the problem by adding swap, no shit. I had the exact same problem until I added swap, even if it's a bit slower, your database won't crash until you fix the problem.

And some posts before said that it might be because of the caching which I don't think it is. I think your caching isn't even working. Because whenever I had the mysql crash, all I was not able to do is get into the wp-admin page. The cached sites were still served and why wouldn't they, that's what the caching is for. But in the wp-admin panel you always need your database so I think there might be an error as well

Edit: look at a cached source code of your page. Normally the caching plug-ins add some text like "cached by $plug-in name". If that's not true for you, you got at least one error
 
OP, I had exactly the same problem for close to two years and tried all kinds of things, including changing several hosting companies. None of them was able to help me fix the issue, but eventually I stumbled on the solution.

Someone else already suggested it -- do yourself a favor and get the Wordfence plug-in and start restricting incoming traffic from bots, crawlers and everyone else. As you are using CloudFlare, as I do, you will have to whitelist all CloudFlare IP addresses (just Google them) and adjust the "How does Wordfence get IPs" option to "Use CloudFlare "CF-Connecting-IP" HTTP header" (the last option). Make sure you do those adjustments, otherwise you'll be having troubles. Oh, and remove the CloudFlare plug-in -- you don't need it.

Since I installed Wordfence I've had no such issues.
 
Be far away from godaddy, you can purchase a hosting from any where,
 
Back
Top