Mysql匯入csv檔案

Claire_ljy發表於2020-04-04

1、登入mysql,進入資料庫;

2、進入到對應的表裡面,輸入以下內容:

含有中文資料:

load data infile 'E:/qzkh.csv'

into table dmpa_test character set gb2312

fields terminated by ',' optionally enclosed by '"' escaped by '"'

lines terminated by '\r\n';

 

不含中文資料:

load data infile 'E:/qzkh.csv'

into table dmpa_test

fields terminated by ',' optionally enclosed by '"' escaped by '"'

lines terminated by '\r\n';

 

(注意:需要修改對應的路徑,表名,分割符)

轉載於:https://www.cnblogs.com/liujiale/p/10938631.html

相關文章