1. create a test table
mysql> create table test(a int not null, b varchar(255));
2. insert data to table
mysql> insert into test values(1, "hello" );
mysql> insert into test values( 2, 'test"');
3. export table to csv file
mysql>select * into outfile '/tmp/result.txt' fiels terminated by ',' optionally enclosed by '"' lines terminated by '/n' from test;
4. empty the table
mysql>delete from test;
5. import from csv
mysql>loda data local infile '/tmp/result.txt' into table test fields terminated by ',' enclosed by '"' lines terminated by '/n';