Solved Wordpress failing to boot on DB upgrades
Seeing the following error in my logs when trying to boot a long running Wordpress managed app
One or more database tables are unavailable. The database may need to be repaired.
Anyone seen this before or have ideas on how to fix?
@adrw do you mean it was stopped before and you tried to start it up again? or is this after a server reboot? I have seen that error message before when the some database tables are missing or some plugin was installed which changes the database table prefix. Do you recall installing any plugins recently?
@girish I'd have to check with the main moderator for that site but I don't think any plugins have been updated recently. I noticed the app was broken and have tried restarting the app and it keeps failing with the same DB failure, not sure if it correlates to a recent Cloudron upgrade.
@girish I submitted a ticket from my Cloudron dashboard, many thanks!
It seems the options table was not accessible and was failing with "MySQL table is marked as crashed and last (automatic?) repair failed". This got fixed by executing "repair table options;" from the mysql prompt.
@girish I have deleted images from wordpress with a plugin instead of from media library and I think I have a problem in the database because of this.
I have seen here: https://developer.wordpress.org/cli/commands/db/repair/
that there is a command to repair database from wp cli.
Database is automatically repaired on app restart? If not, what would be the complete command to repair the database from the app's terminal with wp cli?
Thanks a lot.
@mdreira database is not automatically repaired on restart, no. I am not 100% sure that is safe to run all the time.
@girish Thank you.
Then, what would be the complete command to repair the database from the app terminal with wp cli?
d19dotca last edited by
what would be the complete command to repair the database from the app's terminal with wp cli
The command would just be simply
wp db repairaccording to the WP CLI documentation. For reference, the actual impact of that statement is documented in MySQL's documentation directly.