1

I have a replicated MySQL database that until recently was supported by a DBA. Unfortunately, he has now left so we're playing catch up.

From what I can tell the replication that is set up is:

  • binary_log based (i.e. not GTID)
  • row based
  • the table being altered is InnoDB

I'm basing this on a few things

  1. The output from SHOW SLAVE STATUS references the binary log
  2. The mysql.gtid_executed table on the master and slave are both empty
  3. The output from SHOW GLOBAL VARIABLES LIKE 'binlog_format'; is ROW

The master server is using MySQL version 5.7.9. The slave is using MySQL version 5.7.17

If I change a column name in the master database using the command

ALTER TABLE table_name CHANGE COLUMN old_column_name new_column_name DATETIME NOT NULL 

will the change be replicated to the slave?

Or do I need to change the column name in the slave as well?

1 Answer 1

1

I was able to test this on our replicated environment.

Surprisingly, the column name was updated in the slave environment. I assumed this would not be the case because the row-based replication was configured.

1
  • In spite of using RBR, DDL statements need to be done as if SBR. The guiding premise of Replication is that the Slave will always (with a slight delay) have exactly the same dataset as the Master.
    – Rick James
    May 28, 2017 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.