0

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

2

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.

  • 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
0

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.

0

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?).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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