Rate This Document
Findability
Accuracy
Completeness
Readability

Write Operations Not Allowed on the New Primary Database After a MySQL Primary-Secondary Switchover

Symptom

Write operations are not allowed on the new primary database after a MySQL primary-secondary switchover. That is, the new primary database is in read-only mode.

Key Process and Cause Analysis

Before the MySQL primary-secondary switchover, the secondary database is disabled from writing data. After the switchover, you need to configure the new primary database to allow write operations.

Conclusion and Solution

  1. Configure the new primary database to allow write operations.
    show variables like 'read_only';
    set global read_only=0;
    show variables like 'read_only';

  2. Perform write operations on the new primary database again.