How does 'LOAD DATA INFILE' work in statement-based replication?

It appears that the file you load with LOAD DATA INFILE on the master are automatically transferred via the replication log from the master to the slave. The slave loads these files when it gets to the LOAD DATA INFILE in the statement-based replication queue.

Up vote 6 down vote favorite 2 share g+ share fb share tw.

In MySQL, using statement based replication I assume that every SQL statement gets executed on the slave exactly the same way as on the master. However, when I run the statement: LOAD DATA INFILE 'filename' INTO SomeTable; I'm not sure if the file needs to exist on the slave the same way at it does on the master. Can someone point me to the documentation of this feature?

Mysql replication load-data-infile link|improve this question edited Dec 27 '09 at 3:09OMG Ponies95.2k1065138 asked Dec 10 '08 at 13:01Avi10.7k12244 100% accept rate.

It appears that the file you load with LOAD DATA INFILE on the master are automatically transferred via the replication log from the master to the slave. The slave loads these files when it gets to the LOAD DATA INFILE in the statement-based replication queue. I'm inferring this from a couple of statements in the docs: 16.1: Backing Up Replication Slaves If your MySQL server is a slave replication server, then regardless of the backup method you choose, you should also back up the master.

Info and relay-log. Info files when you back up your slave's data. These files are always needed to resume replication after you restore the slave's data.

If your slave is subject to replicating LOAD DATA INFILE commands, you should also back up any SQL_LOAD-* files that may exist in the directory specified by the --slave-load-tmpdir option. 16.1.2.3: Replication Slave Options and Variables When the slave SQL thread replicates a LOAD DATA INFILE statement, it extracts the file to be loaded from the relay log into temporary files, and then loads these into the table. If the file loaded on the master is huge, the temporary files on the slave are huge, too.

Therefore, it might be advisable to use this option to tell the slave to put temporary files in a directory located in some filesystem that has a lot of available space. In that case, the relay logs are huge as well, so you might also want to use the --relay-log option to place the relay logs in that filesystem.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions