Common SQL Errors

MySQL Error 1077: ER_NORMAL_SHUTDOWN - Causes, Fixes, and Prevention

Galaxy Team
August 5, 2025

Error 1077 signals that the MySQL server or a related service is shutting down normally, interrupting client connections and operations.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 1077?

MySQL Error 1077: ER_NORMAL_SHUTDOWN appears when the server (or a component such as replication I/O thread) closes during a normal shutdown. Reconnect after the service restarts or adjust shutdown scripts to avoid abrupt disconnections.

Error Highlights

Typical Error Message

%s: Normal shutdown

Error Type

Connection Error

Language

MySQL

Symbol

ER_NORMAL_SHUTDOWN

Error Code

1077

SQL State

Explanation

Table of Contents

What is MySQL Error 1077 ER_NORMAL_SHUTDOWN?

Error 1077 with SQLSTATE HY000 surfaces when a MySQL component reports “Normal shutdown.” The server, replication slave, or group-replication member is intentionally terminating, cutting off active sessions.

The message is informational but halts client queries and background threads. Scripts may fail, and replication can lag until the instance restarts.

What Causes This Error?

A controlled STOP or SHUTDOWN command is the primary cause.

Package managers, orchestrators, or operating-system shutdown routines trigger mysqld_safe or systemd to stop MySQL, producing error 1077 in logs and to clients.

Replication I/O and SQL threads also emit 1077 when a CHANGE MASTER TO or STOP SLAVE command requests a clean stop.

How to Fix MySQL Error 1077

Because the shutdown is intentional, the fix is to wait until the server finishes closing and then reconnect.

Automate retry logic in application pools to handle transient loss.

If the shutdown was unexpected, audit cron jobs, systemd timers, and cluster managers to remove unintended service restarts.

Common Scenarios and Solutions

During OS maintenance windows the package manager stops MySQL and triggers 1077. Schedule your batch jobs outside maintenance windows or put the node in read-only mode first.

In replication, issuing STOP SLAVE produces 1077 for the I/O thread.

Restart replication with START SLAVE after configuration changes.

Best Practices to Avoid This Error

Use connection pools that automatically retry. Enable TCP keepalive to detect dead sockets quickly. Configure graceful shutdown scripts that wait for running transactions to complete.

In Galaxy, users can monitor server availability and rerun failed queries once the connection is re-established, keeping workflows resilient.

Related Errors and Solutions

Error 2013 (Lost connection to MySQL server) appears when the server dies unexpectedly.

Unlike 1077, it indicates an unclean stop; check crash logs.

Error 1927 (ER_SLAVE_MUST_STOP) requires stopping replication threads before configuration changes, often preceding a 1077 message.

.

Common Causes

Related Errors

FAQs

Does Error 1077 mean data loss?

No. The shutdown is graceful, so InnoDB flushes pages and binary logs safely. Data remains intact.

Why do my scripts fail during backups?

If a backup framework stops MySQL before snapshotting, active sessions receive 1077. Configure logical backups instead or freeze I/O without stopping MySQL.

How can Galaxy help?

Galaxy detects lost connections, shows clear error banners, and lets you rerun queries once the server is back, minimizing disruption.

Can I suppress the error in logs?

You cannot disable 1077, but you can redirect or rotate logs to prevent noise. Use log_error_verbosity=2 to reduce verbosity while retaining important messages.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo