<p>MySQL raises Error 1836 ER_READ_ONLY_MODE when the server or database is set to read only, blocking any write operations.</p>
<p>MySQL Error 1836 ER_READ_ONLY_MODE appears when the instance or target database is in read only mode, so INSERT, UPDATE, DELETE, and DDL fail. Switch off read only mode or route writes to a primary server to resolve the error.</p>
Running in read-only mode
MySQL returns Error 1836 with the message "Running in read only mode" when a session tries to modify data while the read_only or super_read_only flag is active. The server immediately blocks INSERT, UPDATE, DELETE, CREATE, ALTER, and DROP statements.
This safeguard protects replicas and maintenance environments from accidental writes. Quick remediation is critical because prolonged write failures can break applications, prevent migrations, and cause unexpected downtime.
The read_only or super_read_only variables may be enabled deliberately in my.cnf, during backups, or by automation controlling failover. With these flags ON, only users holding the SUPER or SYSTEM_VARIABLES_ADMIN privilege can issue writes.
Replication setups set replicas to read only to keep binary logs consistent. Managed cloud databases often toggle the flag while they apply patches, snapshots, or failover operations.
Log in with a privileged account and disable read only mode if the host should allow writes. Run SET GLOBAL read_only = OFF and SET GLOBAL super_read_only = OFF, then persist the change in configuration files or with SET PERSIST.
If the host must remain read only, route write traffic to the primary node. Update connection strings, load balancer rules, or proxy configuration so applications use the correct writer endpoint.
Backup scripts often enable read only mode, forget to restore the previous value, and cause deployment failures. Add a cleanup step that resets both variables to their prior state.
In load-balanced clusters only replicas may receive some connections. Enforce writer routing in the pool or use read-write splitting middleware so DML always targets the primary.
Monitor read_only and super_read_only variables with Prometheus or CloudWatch and alert when they flip to ON. Include them in daily SHOW GLOBAL VARIABLES audits.
Automate promotion and routing in replication topologies with tooling like Orchestrator or MHA to ensure applications always reach a writable server.
Error 1290 SQL_CALC_FOUND_ROWS is disabled surfaces when certain SQL features are blocked by server modes. Error 1205 Lock wait timeout exceeded stems from row-level contention rather than server-level read only mode. Each requires a different investigation path.
The my.cnf file may set read_only = 1 or super_read_only = 1, making the server start in read only mode after every restart.
Backup tools frequently toggle read only mode to freeze writes while capturing a snapshot and might not revert the setting when finished.
By default, replicas are configured with read_only ON to avoid writes that would break binary log ordering and crash replication.
Managed database platforms can enable read only during patching or version upgrades, returning the instance to read write afterward.
Error 1290 appears when the requested operation conflicts with the server SQL mode or a specific restricted option.
Error 1205 indicates a transaction could not obtain a lock in time. Unlike Error 1836, the server is writable but row-level contention blocks progress.
Error 1044 occurs when the user lacks privileges to create or modify objects, separate from global read only state.
Yes. SET GLOBAL read_only = OFF and SET GLOBAL super_read_only = OFF take effect immediately. Persist the change with SET PERSIST or by editing my.cnf to avoid it reappearing after a restart.
Your session might be connected to a replica behind a load balancer or proxy. Confirm you are on the intended host with SELECT @@hostname and check that both read_only and super_read_only are OFF.
Disabling read only on a replica can cause data drift and break replication if writes occur. Only disable it when promoting the replica or performing controlled maintenance.
Galaxy highlights server variables in the session sidebar and warns when read only mode is active. The AI copilot suggests appropriate SET commands and lets teams share a verified script to toggle the flags safely.