If I want to change a NOT NULL column to allow for null values, is it safe for me to run that ALTER TABLE on my DB slave, wait for it to catch up, and then promote it to master?
|
|
|||
|
|
|
As you're going from "NOT NULL" to "NULL", this should be ok. Here's what I would do:
Then on the master, run:
[1] MySQL replication runs in two threads on the slave. The I/O thread copies replication data from the master to the slave. The SQL thread executes that SQL on the slave, doing the INSERT/UPDATE/DELETE/etc. You can stop each thread independently of the other. [2] This effects only the session you're in, not other connections from your production applications. You're instructing MySQL not to add any commands you run into the bin log for replication. You need this so that your |
|||
|
|
I just finished reading a great article about using MMM to ALTER huge tables that seems like it would address your problem, assuming you're using or can set up MMM. |
|||
|
|