MYsql Data Text Export and Import I. query the table structure mysql> desc province; + ----------- + ------------- + ------ + ----- + --------- + ---------------- + | Field | Type | Null | Key | Default | Extra | + ----------- + ------------- + ------ + ----------- + ---------------- + | id | int (11) | NO | PRI | NULL | auto_increment | name | varchar (32) | NO | NULL | countryId | int (11) | YES | MUL | NULL | + ----------- + ------ + ----- + -- The data in the --------------------+、table is exported as the example file (.txt). The SQL code select id, name, countryId into outfile "d:/data_out.txt" lines terminated by "\ r \ n" from province; export result: 1 Beijing 12 Shanghai 13 Tianjin 14 Chongqing 15 Heilongjiang 16 Jilin 17 Liaoning 1 ...... Iii. Import a text file to the Database SQL code load data local infile "d:/data_out.txt" into table t_province (id, name); import result: mysql> select * from t_province; + ---- + -------- + | id | name | + ---- + -------- + | 1 | Beijing | 2 | Shanghai | 3 | Tianjin | 4 | Chongqing | 5 | Heilongjiang |