我正在尝试将在UCS2-Big Indian中编码的一个大csv文件导入到mysql表中。
这是mysql代码:
DROP TABLE if exists PAPERS;
CREATE TABLE `PAPERS` (
ID_RESEARCHER VARCHAR(20),
PAPER_ACCESSOR_NUMBER VARCHAR(20),
primary key(ID_RESEARCHER,PAPER_ACCESSOR_NUMBER)
) ENGINE=InnoDB DEFAULT CHARSET=ucs2;
load data local infile '...dump_all_papers_test_2.csv'
into table PAPERS
CHARACTER SET ucs2
fields terminated by '\t' enclosed by '"'
lines terminated by '\n'
(ID_RESEARCHER, PAPER_ACCESSOR_NUMBER);
和csv的内容(格式为ucs-2 Big Indian,用记事本++表示)
"100" "A1974U626600001"
"100" "A1974U626600001"
"100" "A1974U626600001"
csv示例的副本:
错误是:
1 row(s) affected, 2 warning(s):
1265 Data truncated for column 'ID_RESEARCHER' at row 1
1261 Row 1 doesn't contain data for all columns
Records: 1 Deleted: 0 Skipped: 0 Warnings: 2
这里发生了什么?
该操作仅填充第一个字段。是不是mysql支持ucs2?
答案 0 :(得分:0)