1970
MySQLERRORNotableConfigurationHIGH confidence
The MySQL server is running with the --option option so it cannot execute this statement
Production Risk
Low — write is rejected; the read-only protection is working as intended.
What this means
A server startup option or configuration prevents a particular SQL statement from executing. Common examples include --read-only, --super-read-only, and --skip-grant-tables.
Why it happens
- 1Attempting a write operation on a server started with --read-only or --super-read-only.
- 2Trying to use GRANT/REVOKE on a server started with --skip-grant-tables.
How to reproduce
trigger — this will error
trigger — this will error
INSERT INTO t VALUES (1); -- server started with --read-only
expected output
ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement.
Fix 1
Disable the blocking option if appropriate
Disable the blocking option if appropriate
SET GLOBAL read_only = OFF; -- if you have SUPER privilege and the server allows it
Why this works
If the server is intentionally read-only (e.g., a replica), writes should go to the primary.
Fix 2
Direct writes to the primary server
Direct writes to the primary server
-- Configure your application to send writes to the primary and reads to replicas
Why this works
In a replication setup, replicas should be read-only; writes must target the source.
What not to do
✕
Version notes
Sources
Official documentation ↗
MySQL 8.0 — 1970 ER_OPTION_PREVENTS_STATEMENT
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev