• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Fix MySQL Error – ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE

December 20, 2023

How to Fix MySQL Error – ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE

MySQL is a popular open-source relational database management system used by many websites and applications. However, like any software, it can encounter errors that can disrupt its normal operation. One such error is the ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE error. In this article, we will explore what this error means and how to fix it.

Understanding the ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE Error

The ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE error occurs when you try to perform an ALTER TABLE operation on a table that is part of a replication setup. Replication is a feature in MySQL that allows you to create multiple copies of a database for redundancy and scalability.

When you perform an ALTER TABLE operation on a table in a replication setup, MySQL needs to synchronize the changes across all the replicas. However, certain ALTER TABLE operations are not supported in this context, and MySQL will reject them with the ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE error.

Fixing the ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE Error

To fix the ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE error, you have a few options:

1. Use pt-online-schema-change

pt-online-schema-change is a tool from the Percona Toolkit that allows you to perform online schema changes without locking the table. It works by creating a new table with the desired schema, copying the data from the old table to the new one, and then swapping them. This process can be performed without interrupting the replication.

Here’s an example of how to use pt-online-schema-change:

pt-online-schema-change --alter "ADD COLUMN new_column INT" D=mydatabase,t=mytable

Make sure to replace “mydatabase” and “mytable” with the actual database and table names, and “ADD COLUMN new_column INT” with the desired ALTER TABLE operation.

2. Stop the Replication Temporarily

If using pt-online-schema-change is not an option for you, you can stop the replication temporarily, perform the ALTER TABLE operation, and then resume the replication. However, this method will cause a brief interruption in the replication.

To stop the replication, you can use the following SQL statements:

STOP SLAVE;

After performing the ALTER TABLE operation, you can resume the replication with the following SQL statement:

START SLAVE;

3. Perform the ALTER TABLE Operation on Each Replica

If you have multiple replicas in your replication setup, you can perform the ALTER TABLE operation on each replica individually. This method allows you to avoid the ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE error because you are not altering the table on the master.

However, keep in mind that you need to ensure that the ALTER TABLE operation is performed consistently on each replica to maintain data integrity.

Summary

The ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE error can occur when you try to perform an ALTER TABLE operation on a table in a replication setup. To fix this error, you can use tools like pt-online-schema-change, stop the replication temporarily, or perform the ALTER TABLE operation on each replica individually.

If you are experiencing the ER_SYNC_MASTER_REJECTED_UNSUPPORTED_ALTER_ONLINE error or need assistance with MySQL or VPS hosting, consider reaching out to Server.HK. They offer reliable and high-performance VPS hosting solutions to meet your needs.

Recent Posts

  • CentOS Stream Explained: Key Differences from CentOS Linux
  • How to Configure FirewallD in CentOS Stream: From Essential to Production-Grade
  • Installing Docker on CentOS: A Practical Setup Guide (CentOS Stream 9/10 – 2026)
  • How to Secure a CentOS Server: 15 Essential Hardening Techniques (CentOS Stream 9/10 – 2026)
  • CentOS End of Life (EOL): What It Means and Migration Options in 2026

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot