1. 程式人生 > >mysql匯入及匯出txt檔案

mysql匯入及匯出txt檔案

匯入資料庫: mysql>use databasename; mysql>load data infile "E:\\test\\test.txt" into table tablename fields terminated by '|' lines terminated by '\r\n';
如果沒有換行則: mysql>load data infile "E:\\test\\test.txt" into table tablename fields terminated by '|'; 匯出資料庫: mysql>use databasename; mysql> select * into outfile "E:\\test\\test.txt" fields terminated by '|'lines terminated by '\r\n' fromtablename; 如果不要換行則: mysql> select * into outfile "E:\\test\\test.txt" fields terminated by ','from tablename;