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!