DBAtlas · Database operations atlas

1290: ER_OPTION_PREVENTS_STATEMENT: running with the --read-only option

MySQL

What does it mean?

The MySQL server rejected a data-modifying statement (INSERT/UPDATE/DELETE/DDL) because it is running with the --read-only or --super-read-only option. Under read_only, users with CONNECTION_ADMIN/SUPER can still write; with super_read_only enabled they cannot either, and the message reads '--super-read-only option'.

Why does it happen?

read_only=ON or super_read_only=ON; most often an accidental write attempt against a replica. Replicas and Group Replication secondaries are kept read-only for data consistency; failover automation puts the old primary into super_read_only. Writing to the wrong node during failover/switchover also triggers it.

How to fix it

Route writes to the primary (source) server. If this server really should become the new primary: SET GLOBAL read_only = OFF; (turning off read_only automatically turns off super_read_only as well; turning on super_read_only also turns on read_only). Do not change it manually on nodes managed by your HA tool (Orchestrator/Group Replication/InnoDB Cluster). To check the state: SELECT @@read_only, @@super_read_only;

Open in DBAtlas →

More from this engine