DBAtlas · Database operations atlas

1836: ER_READ_ONLY_MODE: Running in read-only mode

MySQL

What does it mean?

InnoDB is running in read-only mode (innodb_read_only=ON) or the data directory/media is read-only; writes and DDL on InnoDB tables are rejected. Note: a write attempt while read_only/super_read_only is enabled returns 1290 (ER_OPTION_PREVENTS_STATEMENT), not this code.

Why does it happen?

The server was started with innodb_read_only=ON (e.g. read-only media, a shared data directory, a copy for analysis); in this mode changes such as INSERT/UPDATE/DELETE and CREATE/DROP/ALTER TABLE cannot be made to InnoDB tables.

How to fix it

If writes are needed, start the server without innodb_read_only: remove the innodb_read_only=ON line from my.cnf and restart (this variable is not dynamic and requires a restart). To check the state: SELECT @@innodb_read_only; Verify that the data directory and file system are writable. If you are writing to a replica/HA secondary (1290), route writes to the primary.

Open in DBAtlas →

More from this engine