One or more database tables are unavailable 📝 WordPress

WordPress: One or more database tables are unavailable. The database may need to be repaired.

WordPress can’t read one or more of its tables — they’re crashed (MyISAM), missing, or the table prefix in wp-config.php is wrong.

Seen on: WordPress

Meaning

Server crashes and full disks corrupt MyISAM tables. Migrations with a different $table_prefix make WordPress look for wp_ tables that don’t exist.

Common causes

  • Corrupted tables after crash/disk full
  • Wrong $table_prefix in wp-config.php
  • Tables missing after a partial import
  • Database user lacking permissions on some tables

⚡ Quick fix

  1. Check $table_prefix matches the tables
  2. Repair: define('WP_ALLOW_REPAIR', true) then visit /wp-admin/maint/repair.php
  3. Re-import missing tables from backup

Detailed fix by platform

WordPress

  1. php
    define('WP_ALLOW_REPAIR', true);   // remove after repairing
    // then open https://example.com/wp-admin/maint/repair.php

Shell

  1. php
    wp db check
    wp db repair
    wp db tables

How to diagnose

  1. Prefix — Tables vs $table_prefix
  2. Health — wp db check
  3. Disk — Free space on the DB server

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.