Mysql 導入導出csv 中文亂碼成績的處理辦法。本站提示廣大學習愛好者:(Mysql 導入導出csv 中文亂碼成績的處理辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是Mysql 導入導出csv 中文亂碼成績的處理辦法正文
導入csv:
load data infile '/test.csv' into table table_name
fields terminated by ',' optionally
enclosed by '"' escaped by '"'
lines terminated by '\r\n'
ignore 1 lines;
導csv:
SELECT * INTO OUTFILE '/test.csv'
FIELDS TERMINATED BY ',' OPTIONALLY
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table_name;
處理導出csv中文亂碼成績:
將csv用txt翻開,另存為,選擇utf8編碼便可。
處理導入成績:
mysql裝置目次下的my.ini,增長以下參數:
[client]
default-character-set=utf8
[mysqld]
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
重啟mysql辦事。