SQL - LOAD DATA INFILE - UTF8 issue

2020-04-08 01:14发布

I get few big database exported to .txt (its around 5GB each) so i found out that i can easy import it with

LOAD DATA LOCAL INFILE '/path/pet.txt' INTO TABLE pet;

it works well but i am having problem with UTF-8 there, because some texts are displaying like PODB¦H Z L DODATELN¦ ZPRACOVAT even that column charset is set for UTF-8 and in .txt file its displayed OK, so problem is somewhere in import. Any idea how can i import it without this problems?

标签: mysql sql utf-8
1条回答
Summer. ? 凉城
2楼-- · 2020-04-08 01:43

I found this : Loading utf-8 encoded text into MySQL table

LOAD DATA LOCAL INFILE '/path/pet.txt' 
INTO TABLE pet
CHARACTER SET UTF8;
查看更多
登录 后发表回答