0

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

Warner
  • 23,440
  • 2
  • 57
  • 69
Greelmo
  • 117
  • 1
  • 6

3 Answers3

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.

Warner
  • 23,440
  • 2
  • 57
  • 69
  • 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.

Kourosh Samia
  • 301
  • 1
  • 5
  • 12
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?).