load data local infile '路径 名称' into table exceltomysql fields terminated by ',' 如果原文本有“,”号 那么他的表就会出现乱七八糟的现象 最好是采取什么样的分隔符?我想问的问题就是这个 谢谢了~
我现在还没碰到这样的问题 但是我就想知道 例如: 我 吃饭 睡觉 上网, 打篮球如果用这个load data local infile '路径 名称' into table exceltomysql fields terminated by ',';导入到mysql中 就会 出现 6列 能不能介绍基本相关mysql数据处理的书籍
CSV格式的文件导入数据库中没问题如果没有引号都好之类的 直接 load data local infile "D://d.csv" into table t; 如果你的是linux系统 load data local infile "/root/test.csv" replace into table t005.TTFClientOrder fields terminated by ',' optionally enclosed by '"' escaped by '\\' lines terminated by '\r\n';
例如: 我 吃饭 睡觉 上网, 打篮球如果用这个load data local infile '路径 名称' into table exceltomysql fields terminated by ',';导入到mysql中 就会 出现 6列 能不能介绍基本相关mysql数据处理的书籍
load data local infile "D://d.csv" into table t;
如果你的是linux系统
load data local infile "/root/test.csv" replace into table t005.TTFClientOrder fields terminated by ',' optionally enclosed by '"' escaped by '\\' lines terminated by '\r\n';
MYSQL官方文档就是最好的书籍。13.2.5. LOAD DATA INFILE语法
http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html#load-data