Loading utf-8 encoded text into MySQL table

后端 未结 5 745
小蘑菇
小蘑菇 2020-11-29 06:37

I have a large CSV file that I am going to load it into a MySQL table. However, these data are encoded into utf-8 format, because they include some non-english characters. I

5条回答
  •  盖世英雄少女心
    2020-11-29 06:54

    Try something like,

    LOAD DATA LOCAL INFILE "file" INTO TABLE message_history CHARACTER SET UTF8 COLUMNS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"';

    Original Structure,

    https://dev.mysql.com/doc/refman/8.0/en/load-data.html

提交回复
热议问题