1290: ER_OPTION_PREVENTS_STATEMENT: running with the --read-only option
MySQLWhat 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;
More from this engine
- 1153Got a packet bigger than 'max_allowed_packet' bytes
- 1969MariaDB: Query execution was interrupted (max_statement_time exceeded)
- 1927MariaDB: ER_CONNECTION_KILLED: Connection was killed
- 1836ER_READ_ONLY_MODE: Running in read-only mode
- 3819ER_CHECK_CONSTRAINT_VIOLATED: Check constraint is violated
- 1118ER_TOO_BIG_ROWSIZE: Row size too large
- 1170ER_BLOB_KEY_WITHOUT_LENGTH: BLOB/TEXT column used in key specification without a key length