TheoryDance
# 需要station_realtime存在
load data infile \'d:/xxxx/station_realtime2013_01.csv\'
into table `station_realtime`
fields terminated by \',\' optionally enclosed by \'"\' escaped by \'"\'
lines terminated by \'\n\';

注意导入文件的格式编码问题,我有N个csv文件,其中N-1个csv文件的编码都是UTF-8,mysql对应的DB也是UTF-8,导入没问题,

有一个文件不是UTF-8的,导入不成功,将该文件编码改为UTF-8就可以了

导出表到csv文件

select first_name,last_name,email from station_realtime2013_01 
into outfile \'d:/station_realtime2013_01.csv\' fields terminated by \',\' optionally enclosed by \'\' lines terminated by \'/n\';

 

分类:

技术点:

相关文章:

  • 2021-11-20
  • 2021-09-28
  • 2021-12-23
  • 2021-11-29
  • 2021-06-10
猜你喜欢
  • 2021-10-03
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2022-03-14
  • 2021-12-19
相关资源
相似解决方案