From Pine View Farm

Down at the Farm 0

For a short while, this blog was throwing the dreaded “Error Establishing a Database Connection” error.

I was able to fix it (quite impressing myself along the way). Here’s what I did, in case you encounter this error yourself.

First, I logged in to may hosting provider and tried to start phpMyAdmin, a tool for managing MySQL and MariaDB databased. PhpMyAdmin could not connect to the database, it threw a socket error; note that the “socket” is not real, it’s virtual.

Then I opened the file manager and renamed the main page from index.php to index.php-wp. It really didn’t matter what I renamed it to, as long as it was no longer index.php. This is because, when a web browser hits a website, the first file it looks for is index.html, then it looks for index.php.

As a matter of course, I keep an index.html file in the root directory of the blog, generally renamed to index.html.[somethingorother] for just such occasions. I renamed it to index.html edited it to include a brief description of the problem, so that, when one of my two or three regular readers hit the blog, they would know that the problem had been noticed and repairs were underway.

I went back to phpMyAdmin and now was able to connect to the database to do a check, repair, and optimize. I do not know why I was able to connect to the database at that point. By best guess is that, with index.php out of action, the database was no longer being called.

I tested that the database was now working–that is, I could connect to the blog normally, renamed to index files to their respective normal names, and tested. Then I breathed a sigh of relief.

And, best of all, I didn’t have to call tech support. My hosting provider’s tech support is excellent, but even so . . . .

Share

Comments are closed.

From Pine View Farm
Privacy Policy

This website does not track you.

It contains no private information. It does not drop persistent cookies, does not collect data other than incoming ip addresses and page views (the internet is a public place), and certainly does not collect and sell your information to others.

Some sites that I link to may try to track you, but that's between you and them, not you and me.

I do collect statistics, but I use a simple stand-alone Wordpress plugin, not third-party services such as Google Analitics over which I have no control.

Finally, this is website is a hobby. It's a hobby in which I am deeply invested, about which I care deeply, and which has enabled me to learn a lot about computers and computing, but it is still ultimately an avocation, not a vocation; it is certainly not a money-making enterprise (unless you click the "Donate" button--go ahead, you can be the first!).

I appreciate your visiting this site, and I desire not to violate your trust.