mysql导入text,csv - 老马资料库

mysql导入text,csv

类别:程序开发 时间:2023-03-03 00:24:15 点击:344

#导入txt到mysql

load data local infile 'c:/phone.txt'

into table phone

fields terminated by '\t'

lines terminated by '\r\n'

(pref, phone, province,city,isp,post_code,city_code,area_code);



#导入csv到mysql

load data local infile 'c:/phone.csv'

into table  phone

fields terminated by ',' 

optionally enclosed by '"'

escaped by '"' 

lines terminated by '\r\n'

(pref, phone, province,city,isp,post_code,city_code,area_code);