autoincrement). You are using the power of replication to reproduce the table on the slaves. There are two forms of this process, based on which form of logging you are using.
If you are using statement-based logging, run the following for each table:
SELECT * INTO OUTFILE 't1.txt' FROM t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 ...; LOAD DATA INFILE 't1.txt' INTO TABLE t1;
If you are using row-based logging, the temporary table is not transferred to the slave. Therefore, send only the data that is necessary to bootstrap the table using the
INSERT INTOcommand as follows:
CREATE TEMPORARY TABLE t1_tmp LIKE t1; INSERT INTO t1_tmp SELECT * FROM t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT * FROM t1_tmp;
Learn more about this topic from MySQL High Availability.
Server bottlenecks and failures are a fact of life in any database deployment, but they don't have to bring everything to a halt. MySQL provides several features that can protect you from outages, whether you're running directly on the hardware, on virtual machines, or in the cloud. This book shows you how to use these features effectively, and helps you determine which combination of features will give you the most reliable system for a price you can afford.