* SQL level backup of a table
SELECT ... INTO OUTFILE 또는 BACKUP TABLE
* SQL level load of a table
LOAD DATA INFILE 또는 RESTORE TABLE
다음은 사용 예입니다.
mysql> USE db1;
mysql> SELECT * INTO OUTFILE "data.txt" FROM test_table;
mysql> USE db1;
mysql> LOAD DATA INFILE "data.txt" INTO TABLE test_table;
mysql> BACKUP TABLE tbl_name[,tbl_name...] TO '/path/to/backup/directory'
mysql> RESTORE TABLE tbl_name[,tbl_name...] FROM '/path/to/backup/directory'
1. select 결과 -> text 출력
sql> SELECT * INTO OUTFILE '출력파일.txt' fields terminated by '|' lines terminated by '|\r\n' FROM 테이블;
2. text ==> db
sql> load data infile '출력파일.txt' into table 테이블 fields terminated by '|' lines terminated by '\n';
mysqldump -u root -p ljk_test --no-data > testtest.sql