Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have some MySQL replication going on, and want to change the schema of the slave by adding a column. Will this work?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Yes. Keep in mind, the queries will replicate and execute identically on the slave as with the master. If the column is on the end of the table, it could simply use the default value. If it is in the middle, you could introduce data type conflicts or potentially even replication failure if the insert failed.

share|improve this answer
    
It all depends on the query syntax. If your SQL queries always qualify all columns for all inserts and updates, then you should be able to do it. –  wolfgangsz Sep 15 '10 at 23:37

Yes it is possible but you have to remember that if you have transaction on master and row level lock on the slave using MyISAM it does the table lock and will be slower. Also, if you want to change the slave to master in case of disaster then you have to remember to change the engine. Using MyISAM on slave can make your select queries faster.

share|improve this answer

Engine changes between Master and Slave are common, but schema differences like that don't tend to work out well in the end - you're just asking for pain in a disaster-recovery situation (You have performed a live DR test, right?).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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