2

文件内容是这样的

'COGT','COGT','COGENT ORD'
'COG','COG','CABOT OIL & GAS ORD'
'COGZF','COGZF','COGSTATE ORD'
'COHG','COHG','CHEETAH OIL & GAS ORD'
'COHIQ','COHIQ','COHO ENERGY ORD'
'COHM','COHM','ALL AMERICAN GROUP ORD'
'COHN','COHN','COHEN ORD'
'COHR','COHR','COHERENT '

但是我需要将它放入一个包含列名称的mysql数据库中

NAME   |      DESCRIPTION
cogt   |      cogt ord
cog    |      cabot oil

如果您有任何想法,请与我分享

4

1 回答 1

5

然后,您可以通过运行将其导入 MySQL 表:

load data local infile 'input_file.csv' into table tblUniq fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(NAME, DESCRIPTION)
于 2012-06-11T07:03:01.433 回答