How to Fix MySQL Error 1199 (ER_SLAVE_NOT_RUNNING)

Published
Length
3 min read

Luis Felipe Dias

All posts

You get mysql error 1199 when you run a replica task while replication threads are stopped. To fix this failure, set up the replica node and start the replica process. MySQL maps this issue to the ER_SLAVE_NOT_RUNNING symbol and the HY000 SQL state. The server returns a message stating that the action needs a running replica. Database teams see this error during data sync checks, switchovers, or maintenance tasks. Understanding why the threads stopped helps you restore data flow without losing

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You get mysql error 1199 when you run a replica task while replication threads are stopped. To fix this failure, set up the replica node and start the replica process.

MySQL maps this issue to the ER_SLAVE_NOT_RUNNING symbol and the HY000 SQL state. The server returns a message stating that the action needs a running replica. Database teams see this error during data sync checks, switchovers, or maintenance tasks. Understanding why the threads stopped helps you restore data flow without losing rows.

What causes mysql error 1199 in database clusters

MySQL replication relies on two main background threads on the replica server. The input thread reads binary log events from the source database server. The SQL thread runs those saved events against the local replica tables. If either thread stops or lacks setup data, the server blocks replica tasks.

Several common problems can stop these replication threads in a live cluster. A network drop can break the link between the source and replica nodes. Bad login keys or missing user roles on the source also stop the input thread. On the replica side, a broken query or duplicate key halts the SQL thread.

Sometimes a new replica server has no source connection details set up yet. If an engineer runs a task that expects active sync, the engine throws code 1199. Server restarts can also leave replica threads off if auto-start rules are disabled. Disk space limits on the replica can stop relay log writes and halt sync.

How to diagnose and fix the replica state safely

Start by checking the current replica status on the affected database node. Look at the state of both the input thread and the SQL thread. Read the last error message fields in the status output for exact clues. This output tells you whether the failure is a network issue or data conflict.

If the status shows no source details, set up the source host and log position. Make sure the replication user account has the right role on the source server. Test the network path between the two database hosts to confirm open ports. Verify that the disk has enough free space to write new relay logs.

MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

If a data conflict stopped the SQL thread, do not skip transactions blindly. Skipping events creates silent data drift between your source and replica servers. Compare the row data on both nodes to fix the mismatch safely. Once the conflict is clear, start the replica threads and check the status again.

How to prevent replication errors during maintenance

Most replication failures happen when humans or scripts run changes on the wrong node. Always set replica servers to read-only mode for standard app and user accounts. Read-only rules stop accidental writes that cause duplicate keys and break the SQL thread. Keep admin roles tight so only approved engineers can change replica settings.

Monitor the state of both replication threads with alerts in your logging tools. Early alerts let your team fix broken links before binary logs expire on the source. Document your maintenance steps so operators check thread status before running sync tasks. Good access controls and clear checks keep your database cluster stable and healthy.

Inspect every MySQL query and response in flight

Static grants and network rules block bad logins. They cannot pause a risky query for review or mask emails in a result set. By design, hoop.dev sits inline in the MySQL protocol as a sidecar for your MySQL. For every plain query, prepared statement, or cursor an agent or human runs in production, hoop.dev decides to pass, mask, block, or hold it for review.

First, hoop.dev guardrails block banned actions before MySQL runs them, and an AI Analyzer you configure can score intent or escalate for approval. Next, hoop.dev data masking rewrites sensitive string columns in results in memory, and every verdict goes to the audit trail. Find the open-source binary on GitHub.

Frequently asked questions

What does the ER_SLAVE_NOT_RUNNING symbol mean in MySQL?

It means you ran a command that requires active replication while the replica is stopped. You must set up the source link and start the replica threads first.

Can a network drop trigger mysql error 1199?

Yes, a network drop can stop the input thread from reading source logs. If you then run a task that needs active sync, MySQL returns error 1199.

Is it safe to skip errors to start the replica again?

No, skipping replication errors causes your replica data to drift from the source. Always fix the root data conflict or rebuild the replica from a clean backup.

The query runs. The emails stay hidden.