SELECT * INTO OUTFILE 'file_name' FROM tbl_name 
and restore with:
LOAD DATA INFILE 'file_name' REPLACE ... 
To avoid duplicate records, you need a PRIMARY KEY or a UNIQUE key in the table. 
The REPLACE keyword causes old records to be replaced with new ones when a new 
record duplicates an old record on a unique key value.

Post By Editor (2,827 Posts)

Website: →

Connect