Common SQL Errors

MySQL Error 3190: ER_CANT_RESET_MASTER - How to Fix and Prevent

Galaxy Team
August 8, 2025

MySQL raises error 3190 (ER_CANT_RESET_MASTER) when the RESET MASTER command is blocked because the server is in a state that makes purging the binary log unsafe.

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 3190 (ER_CANT_RESET_MASTER)?

ER_CANT_RESET_MASTER appears when MySQL blocks the RESET MASTER command to protect replication consistency. Check for running replication threads, active GTID transactions, or binary log file locks, then stop replication and retry RESET MASTER to resolve the issue.

Error Highlights

Typical Error Message

ER_CANT_RESET_MASTER

Error Type

Replication Error

Language

MySQL

Symbol

ER_CANT_RESET_MASTER was added in 5.7.14.

Error Code

3190

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 3190 (ER_CANT_RESET_MASTER)?

MySQL error 3190, condition name ER_CANT_RESET_MASTER, is thrown when you run RESET MASTER but the server decides the operation is unsafe. The %s placeholder in the error message is replaced with a reason such as "slave running" or "super_read_only enabled".

RESET MASTER deletes all existing binary log files and creates a new one. MySQL therefore blocks the command if replication threads are active, global transaction identifier (GTID) state is inconsistent, or the server is read only. Fixing the error quickly is vital to keep replication healthy and free disk space.

What Causes This Error?

The error is usually caused by active replication activity. If IO_THREAD or SQL_THREAD is running, MySQL refuses to purge binary logs to prevent data loss on replicas.

Another cause is super_read_only or read_only mode. When these flags are ON, administrative commands that modify data or logs are disallowed, including RESET MASTER.

In GTID mode, pending transactions must be flushed to the binary log before it can be reset. Any gap forces MySQL to abort the RESET MASTER request.

How to Fix ER_CANT_RESET_MASTER

First, stop all replication threads with STOP SLAVE or STOP REPLICA, depending on your version. Confirm they are no longer running by inspecting SHOW SLAVE STATUS.

Next, disable read only restrictions by issuing SET GLOBAL super_read_only = OFF and SET GLOBAL read_only = OFF if they are enabled. Ensure you have SUPER privilege.

Finally, run RESET MASTER again. MySQL should create a fresh binary log file, clearing the error. Remember to start replication threads afterward with START SLAVE or START REPLICA.

Common Scenarios and Solutions

On primary servers with replicas connected, DBAs forget to stop replication before purging logs. A quick STOP SLAVE IO_THREAD is sufficient to allow RESET MASTER.

Cloud environments may enable super_read_only automatically during failover. Turning it off temporarily lets you reset the binary log.

During major maintenance, GTID_PURGED might be non-empty. FLUSH TABLES WITH READ LOCK then UNLOCK TABLES ensures all GTIDs are flushed so RESET MASTER can succeed.

Best Practices to Avoid This Error

Automate log rotation with PURGE BINARY LOGS TO 'mysql-bin.XXXXXX' or based on binlog_expire_logs_seconds so manual RESET MASTER is rarely needed.

Always stop replication and verify the node is a standalone primary before running destructive commands. Use scripts that perform safety checks.

Monitor read only flags and GTID consistency with performance_schema tables or an observability tool so issues are caught early.

Related Errors and Solutions

Error 1186 (ER_BINLOG_PURGE_PROHIBITED) appears when PURGE BINARY LOGS is unsafe for similar reasons. The fix is the same: stop replication and clear read only state.

Error 1792 (ER_GTID_PURGED_WAS_CHANGED) surfaces when GTID_PURGED is altered incorrectly. Restoring consistent GTID_PURGED eliminates the problem.

Common Causes

Active replication threads

RESET MASTER cannot execute while IO_THREAD or SQL_THREAD is running because replicas still need the binary logs.

super_read_only or read_only enabled

These server modes block administrative changes, stopping RESET MASTER until they are disabled.

Unflushed GTID transactions

Pending GTID events must be written to the binary log before it is reset; otherwise consistency is at risk.

Related Errors

Error 1186 ER_BINLOG_PURGE_PROHIBITED

Occurs when PURGE BINARY LOGS is unsafe. Stop replication and disable read only modes to resolve.

Error 1792 ER_GTID_PURGED_WAS_CHANGED

Raised when GTID_PURGED is changed inconsistently. Fix by setting GTID_PURGED to a correct contiguous set.

Error 1381 ER_UNKNOWN_ERROR_ON_WRITE

Appears when writes are attempted in read only mode. Turning off super_read_only clears the error.

FAQs

Can I run RESET MASTER on a replica?

Do not run RESET MASTER on a replica that still needs binary logs from the primary. Use PURGE BINARY LOGS on replicas or wait until they have processed all events.

Does RESET MASTER remove GTID history?

The command resets binary log files but preserves GTID_EXECUTED and GTID_PURGED information, keeping GTID replication intact.

Is there a safer alternative to RESET MASTER?

Yes. PURGE BINARY LOGS TO or PURGE BINARY LOGS BEFORE removes only older logs while keeping the current file. This is less disruptive.

How does Galaxy help avoid this error?

Galaxy lets you script safety checks into shared, versioned queries. Team members can run vetted maintenance snippets that automatically stop replication and verify server state before issuing RESET MASTER.

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