Error
Error Code: 1286

MariaDB Error 1286: Unknown Storage Engine

📦 MariaDB
📋

Description

MariaDB Error 1286, 'Unknown storage engine '%s'', occurs when the database server tries to use a storage engine that it does not recognize or that is not enabled. This typically happens during `CREATE TABLE` or `ALTER TABLE` statements if the specified engine is misspelled, disabled, or not compiled into the MariaDB instance.
💬

Error Message

Unknown storage engine '%s'
🔍

Known Causes

3 known causes
⚠️
Incorrect Engine Spelling
The name of the storage engine specified in the SQL statement contains a typo or incorrect casing.
⚠️
Engine Not Enabled/Installed
The MariaDB server instance was not compiled with support for the requested engine, or the engine has been explicitly disabled in its configuration.
⚠️
Missing Engine Plugin Files
For engines that load as plugins (e.g., TokuDB, CONNECT), the necessary plugin files are absent or corrupted on the server.
🛠️

Solutions

3 solutions available

1. Enable the Missing Storage Engine easy

Ensure the storage engine specified in your query is enabled in MariaDB.

1
Check which storage engines are currently enabled on your MariaDB server.
SHOW ENGINES;
2
If the required storage engine (e.g., InnoDB, MyISAM, Aria) is listed as 'DISABLED' or not present, you need to enable it. This is typically done in the MariaDB configuration file (`my.cnf` or `my.ini`). The exact configuration directive depends on the engine. For example, to ensure InnoDB is enabled (which is usually the default), you might look for or add a line like this under the `[mysqld]` section:
[mysqld]
default_storage_engine=InnoDB
3
For other engines like Aria, you would ensure the relevant plugin is loaded. You can often enable plugins by adding them to the `plugins` variable in your `my.cnf` or `my.ini` file under the `[mysqld]` section.
[mysqld]
plugins=engines_storage
4
After modifying the configuration file, restart the MariaDB service for the changes to take effect.
sudo systemctl restart mariadb
5
Re-run the SQL query that caused the error. If the storage engine is now enabled, the query should succeed.

2. Correct the Storage Engine Name in Your Query easy

Verify and fix typos or incorrect storage engine names in your SQL statements.

1
Carefully review the SQL statement that generated the error. Pay close attention to the `ENGINE=` clause when creating or altering tables.
CREATE TABLE my_table (id INT PRIMARY KEY) ENGINE=MYISAM;
2
Compare the storage engine name used in your query with the list of available engines shown by `SHOW ENGINES;`.
SHOW ENGINES;
3
Correct any spelling mistakes or use the correct, supported name for the storage engine. For example, if you intended to use InnoDB but typed 'innoDB', correct it to `ENGINE=InnoDB`.
4
Re-execute the corrected SQL statement.

3. Set a Default Storage Engine medium

Configure MariaDB to use a supported storage engine as the default if no engine is specified.

1
Edit your MariaDB configuration file (`my.cnf` or `my.ini`). The location can vary but is often in `/etc/mysql/my.cnf`, `/etc/my.cnf`, or `/etc/mysql/mariadb.conf.d/50-server.cnf`.
sudo nano /etc/mysql/my.cnf
2
Add or modify the `default_storage_engine` directive under the `[mysqld]` section. Ensure the value is a valid and enabled storage engine (e.g., InnoDB, Aria, MyISAM). InnoDB is usually the recommended default.
[mysqld]
default_storage_engine=InnoDB
3
Save the changes to the configuration file and restart the MariaDB service.
sudo systemctl restart mariadb
4
Now, when you create tables without explicitly specifying an `ENGINE=`, MariaDB will use the `default_storage_engine`.
🔗

Related Errors

5 related errors