要是不能设置大点的话肯定要做check,超过存储长度就进行截取,然后存。要么就把varchar设置到500(此时不会自动转成text,效率依然很高),还不够
大你
就设成text吧,再就认为check截取,别期待mysql能自动帮你处理。
load data infile 'C:\\Users\\UserName\\Desktop\\test.csv'into table `table`
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\n'
mysql导入csv
select * from `table`
load data infile 'C:\\Users\\UserName\\Desktop\\test.csv'
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\n'
如果乱码,可用相关编辑器打开.csv文件,另存为utf-
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)