A week or so ago now (time gets away from me in the most appalling fashion) I was about to post something on my personal blog when I encountered an unexpected problem. I got an “Error establishing database connection” message. Say what?
This frequently means there’s something wrong in your wp-config.php file, or maybe your .htaccess file. The problem is, that site, and this one, are part of a WordPress Multisite installation, and there was nothing wrong with most of the other sites, including the top-level site, Rhymes with Sketch. And sub-sites in a Multisite installation don’t have their own wp-config.php or .htaccess files.
Like any sensible person, I asked Mika Epstein (better known as Ipstenu) and Ron and Andrea Rennick for advice. Ron told me to check the database tables for the affected site, so off I went into phpMyAdmin to take a look.
I couldn’t even see the tables in question. I got a big red error message saying that they were damaged and I would have to repair them. But there was nothing within phpMyAdmin that would let me repair them.
Feeling slightly panicked, I turned to Google. (By this time it was late enough in California and far past the Rennicks’ bedtime in Canada.) I learned that I needed to log into cPanel and go to the MySQL management page. The solution to my problem lay in something I’d never paid any attention to before:
When I checked the database, I found all kinds of errors, not just in the tables for the personal blog, but for one of the other sites. Clicking the “Repair DB” button fixed everything, though.
I did look at my error log, and found that there were memory problems and, well, enough other things to make it a very large log file. In my general state of overwhelm I deleted the log file rather than studying it, so I’m not sure quite what went wrong to trigger the problem.
Since it was a very strange problem, however, and not one I’d heard about before, I thought I should write something about it in case anyone else had this issue, either with Multisite or single installations.