Persistent Database Connection Error
-
Hi,
I’m not sure if this is the right place to post this so feel free to move!
I’ve been getting a persistent ‘error establishing a database connection’ error. The error only occurs when I make changes to a page and then try to update it. It lasts for only a few seconds (maybe 30 max) and then stops and I can visit my site as normal. It also doesn’t occur every single time that I try to update a page; it only happens randomly and I’ve been unable to reliably replicate it.
Here’s what I’ve tried to fix it:
-Optimizing/repairing the database
-Verifying login credentials in wp-config.php
-Painstakingly testing each plugin one by one multiple times
-Enabling the error log
-Contacting my host multiple timesThe error log only showed 3 messages, all of which related to plugins. I tried disabling 2 of the plugins and the error persisted.
The third error message was this:
Notice: Undefined variable: parent_style in /home/x/public_html/wp-content/themes/NepalBuzz-Child/functions.php on line 13
I used a child theme plugin to create my current theme so I’m not sure how I would even go about fixing this error. Still, I don’t believe that this error is causing the issue because I’ve been using this theme since the very beginning of my site and never had any problems up until now.
When I contacted my hosting service they ultimately told me that the error was happening because we were using too much disk space and our site wasn’t optimized. I did a ton of work on our site analyzing pages using GMetrix to optimize them (I haven’t had a chance to do every single page yet since I’ve been busy working on other things, but I made a dent), installed a cache plugin that increased our site’s speed by a lot, and also deleted a bunch of unneeded files from cpanel. This seemed to help for a while, but the database connection error came back.
Is my hosting service right? Is it possible that this error is because we’re using up too much space/our site isn’t optimized? What can I do to resolve this? I deleted as many unnecessary files as I could and I’m going to go back to work on optimizing more pages (unfortunately I can’t really delete any plugins because we need all the ones we’re currently using). It just seems strange that this would cause a database connection error, especially since I’ve Googled this issue multiple times and followed many guides trying to resolve this error, and none of them mentioned this as a possible cause. Then again, I’m not a developer so I could be wrong.
Any help/advice on fixing this issue once and for all would be very much appreciated! Thank you!
The topic ‘Persistent Database Connection Error’ is closed to new replies.