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;

你可能感兴趣的:(mysql,jdbc)