Select Page

WordPress Site Stuck in Maintenance Mode

Plugin Error Code 500 During Update

While I was updating a WordPress plugin locally, something happened on my local server to trigger a 500 error code as the plugin was updating. On the frontend, I refreshed the page and was greeted with “Briefly Unavailable for Scheduled Maintenance. Check back in a minute”

This message is typical during the one or two seconds it takes to update a plugin or a theme, but this was taking a while. After refreshing my admin screen, I received the same scheduled maintenance error. The admin dashboard was no longer accessible. The following error was in my local server log:

[ERROR] mysqld.exe: Table '.\\local\\wp_options' is marked as crashed and should be repaired.

After a quick search, I found this awesome article by Chris Jean (Thanks, Chris!) explaining how to resolve errors in database tables. I just wanted to do a quick write up just because I don’t find myself in the sql shell all too often, and it’s mostly for my own notes. In my scenario, I was running LocalWP, so the database was named local and the user/pass is root which is fine for local development, not for production.

To connect click the open site shell button:

Since this is a local environment with default login credentials you can open the mysql shell simply by running mysql with no params or creds.

It should be noted, at the time of writing, ZSH and Local running PHP 8 or higher, will not allow for users to open the site shell as documented in this support forum

Also, as Chris’s article covers, you can correct the issue by running it in the shell or via PHPMyAdmin, which is Adminer in LocalWP:

From there you can repair the offending table. Just make sure you know exactly what your database name is and what your prefix is. That thew me off for a second when chris calls prefix_post in his code, but that prefix depends on whatever the prefix is on your wordpress table, whatever that is. The default is typcially _wp but that isn’t always the case. Hope this helps. And I was hoping to have screenshots of WPCLI running locally, but I ran into some issues. Perhaps that’ll be in the next blog post!

Check out more articles

First Open Source Contribution

Surprise! I genuinely did not plan on making my first ever open source contribution today. In fact, I didn't plan on a lot of things happening this week at all. I recently got an awesome opportunity to work on a site that is being hosted on a platform called Pantheon,...

How to Exclude Specific Posts and Pages from WP_QUERY

For the sake of having something to work with, let's suppose we've got the following query:In this query, inside the $args array, there's a special parameter that allows you to exclude specific posts and pages from the query. This parameter is called post__not_in and...

Configure SSH For Password-less Connections

Preamble I'm slightly embarrassed to admit this, but it was a long time before I figured out how amazing this little file is and how exactly to put it to good use. The file I'm talking about is the SSH config file. By default, when you first connect to a server via...

Creating a WordPress Plugin Downloader

How it Started I was recently tasked with the challenge of creating a WordPress theme generator. The idea being, instead of writing your style.css file from scratch, you'd be able to just answer a few simple questions about how you'd like your theme set up, and those...

Fix Audio on XFCE Chromebook

The Problem After moving from GalliumOS to Xubuntu, I noticed that playing YouTube videos on both Firefox and Chromium would result in decent playback for a few minutes, but suddenly the audio would turn into a solid beeping tone while the YouTube video displayed the...

Adjust Trackpad Sensitivity XFCE

xinput set-prop "Elan Touchpad" "Synaptics Finger" 1 1 1 What are the values 1 1 1? This sets the sensitivity as close to the original ChromeOS as possible. Larger numbers will decrease sensitivity of various aspects. I never looked into which individual value...

Fireworks (Short Film)

https://vimeo.com/395077249 About the film Year: 2020 Director/DP: Tim Searfoss Writers: Matt Jones, Tim Searfoss Sound Mix: Matt Jones

Hosting Multiple Sites Using LocalWP

I've done a write-up on hosting local WordPress sites before, but I definitely prefer this method over the previous one. If you've never tried hosting multiple sites using LocalWP, then I'd encourage you to check it out. I've had really bad issues with it in the past,...

How To Load Javascript in WordPress

Doing things the WordPressy Way Yes, technically it's possible to just drop scripts into template files, but it's not the correct method to use on WordPress sites. WordPress is pretty particular on how it handles JS. Register Scripts via functions.php Just a heads up,...

How To Display Different Sidebars For Different Pages

Page Template (Best for Single Pages) If you only need to call a different sidebar on a single page and that page is totally unique, and there's no need to have a plan for children of those pages, then a simple page template should do the trick. Just go to your parent...