MySQL批量导入数据

MySQL提供的批量导入数据的命令是:

Load Data InFile 'e:/hetongtxt' Into Table `合同` fields terminated by '  ' lines terminated by '\r\n';

fileds terminated by '',表示字段之间的间隔符,lines terminated by ''表示换行符,Windows下用'\r\n',注意文件名和路径最好都是英文的,数据库的字符集和txt的保存编码要一致。

对于导入整个表的数据还是很好用的,但是怎么实现导入到特定列的数据呢,还有怎么导入包含空格的数据呢

要导入到数据库的特定字段的方法其实很简单,在 into table table_name(property1, property2[,...]) ..就可以了

转载于:https://www.cnblogs.com/kiwi/archive/2012/11/29/2793974.html

猜你喜欢

转载自blog.csdn.net/weixin_34242819/article/details/94125757
今日推荐