MySQL raises ER_SERVER_OFFLINE_MODE (3032, SQLSTATE HY000) when the instance is started or switched into offline mode, blocking new client connections until the mode is disabled.
MySQL ER_SERVER_OFFLINE_MODE (error 3032) appears when the server runs in offline mode and refuses normal client logins. Connect with SUPER privileges or disable offline mode with SET GLOBAL offline_mode = OFF or by removing the --offline-mode startup flag.
ER_SERVER_OFFLINE_MODE
MySQL returns ER_SERVER_OFFLINE_MODE when the server has been started with the --offline-mode option or when the global variable offline_mode is set to ON at runtime.
In offline mode, only users that hold the SUPER privilege can connect. All other connection attempts receive SQLSTATE HY000 and the message The server is currently in offline mode.
Knowing how to exit this state quickly is critical for restoring application availability and avoiding cascading failures.
The most common trigger is starting mysqld with the --offline-mode flag during maintenance. Administrators sometimes forget to remove the flag in production restart scripts.
The error also occurs when an administrator sets SET GLOBAL offline_mode = ON during maintenance and later neglects to switch it back.
Upgrades from versions prior to 5.7.5 that re-use deprecated init scripts can accidentally enable offline mode.
First, connect as a SUPER user from the local host or a trusted bastion. Regular accounts cannot log in while offline mode is active.
Once connected, disable offline mode immediately:
SET GLOBAL offline_mode = OFF;
Verify the change and allow new logins:
SHOW GLOBAL VARIABLES LIKE 'offline_mode';
If the server was started with --offline-mode, remove that flag from my.cnf or startup scripts and restart MySQL to prevent recurrence.
Planned maintenance overran - Clear offline mode with SET GLOBAL offline_mode = OFF and monitor connection counts.
Automated restart script includes --offline-mode - Edit the service file, remove the flag, and restart MySQL.
Emergency fail-safe enabled by on-call engineer - Document the incident, disable offline mode, and store a playbook in Galaxy so the team can run the fix quickly.
Store maintenance procedures as reviewed Galaxy queries so everyone follows the same playbook.
Avoid embedding --offline-mode in permanent configuration. Prefer SET GLOBAL offline_mode when a short maintenance window is required.
Use monitoring that alerts if offline_mode remains ON for more than a few minutes.
ER_SERVER_SHUTDOWN happens when the server is closing down completely, not just offline mode. Restart the instance.
ER_CON_COUNT_ERROR signals the connection limit is reached. Increase max_connections or tune workload.
ER_BAD_DB_ERROR indicates the requested database does not exist, unrelated to offline mode, but can appear after maintenance.
The --offline-mode option is present in my.cnf and persists across restarts.
An administrator enabled offline mode during maintenance and forgot to disable it afterwards.
CI/CD or orchestration tools include offline_mode toggles that fire during deploys.
Legacy init scripts copied into newer MySQL versions may still set offline_mode by default.
The server is shutting down, not just offline. Wait for restart or start the service.
Too many connections - different root cause but also blocks clients.
Host blocked due to failed logins - unrelated to offline mode but causes access issues.
User-specific connection limit reached - adjust max_user_connections.
No. Only accounts with the SUPER privilege can connect and toggle offline_mode while the server is offline.
No. SET GLOBAL offline_mode = OFF takes effect immediately. A restart is only needed if --offline-mode is in the configuration file.
Existing connections remain intact. New non-SUPER clients can connect as usual after the flag is cleared.
Galaxy lets teams store the exact recovery SQL in shared Collections, ensuring on-call engineers can quickly disable offline mode and document the change.