1958
MySQLWARNINGNotableSchemaHIGH confidence

Table needs to be upgraded; run CHECK TABLE

Production Risk

Medium — the table may work but is not guaranteed to be stable.

What this means

MySQL detected that a table was created with an older format and needs to be upgraded to be compatible with the current version. The table is still accessible but may behave incorrectly.

Why it happens
  1. 1Table opened after a MySQL upgrade where the table format changed between versions.
  2. 2Obsolete MyISAM or Aria table format detected.
How to reproduce
trigger — this will error
trigger — this will error
CHECK TABLE old_table; -- returns upgrade needed

expected output

Warning 1958: Table 'db'.'old_table' is marked as crashed and needs to be upgraded.

Fix

Run REPAIR TABLE or ALTER TABLE ... ENGINE to upgrade

Run REPAIR TABLE or ALTER TABLE ... ENGINE to upgrade
REPAIR TABLE old_table;
-- Or force a rebuild:
ALTER TABLE old_table ENGINE=InnoDB;

Why this works

Repairing or rebuilding the table updates the format to the current version.

Sources
Official documentation ↗

MySQL 8.0 — 1958 ER_TABLE_NEEDS_UPGRADE

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors