3371
MySQLERRORCommonInnoDB / TablespacesHIGH confidence

Encrypted tablespace requires a keyring key

Production Risk

High — encrypted tablespace cannot be created or accessed; may block application startup.

How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENCRYPTION='Y';

expected output

ERROR 3371 (HY000): Encryption key not found in keyring.

Fix

Load keyring plugin and generate key

Load keyring plugin and generate key
INSTALL PLUGIN keyring_file SONAME 'keyring_file.so'; ALTER INSTANCE ROTATE INNODB MASTER KEY;

Why this works

Installs the keyring plugin and generates a new master encryption key for InnoDB.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3371 ER_TABLESPACE_ENCRYPTION_REQUIRES_KEY

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

← All MySQL errors