1031
MariaDBERRORCommonDDLHIGH confidence

Table storage engine does not have this option

Production Risk

Low — DDL fails cleanly; no data loss.

What this means

ER_ILLEGAL_HA (1031, SQLSTATE HY000) is raised when a table option is specified that the chosen storage engine does not support, such as using FOREIGN KEY with MyISAM or specifying an unsupported ROW_FORMAT.

Why it happens
  1. 1Using FOREIGN KEY, transactions, or other InnoDB-specific features with MyISAM
  2. 2Specifying a ROW_FORMAT not supported by the storage engine
  3. 3Using TABLESPACE or ENCRYPTION options with engines that do not support them
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (id INT) ENGINE=MyISAM ROW_FORMAT=COMPRESSED;

expected output

ERROR 1031 (HY000): Table storage engine for 't' doesn't have this option

Fix

Switch to InnoDB or remove the unsupported option

WHEN The feature requires InnoDB.

Switch to InnoDB or remove the unsupported option
-- Use InnoDB for FK, transactions, compression:
CREATE TABLE t (id INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;

Why this works

InnoDB supports a much wider range of table options than MyISAM or other engines.

What not to do

Ignore 1031 and assume the option was applied

Some engines silently ignore unsupported options in older versions; verify with SHOW CREATE TABLE.

Sources
Official documentation ↗

MySQL 8.0 — 1031 ER_ILLEGAL_HA

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

← All MariaDB errors