0

I want to create a sql table from a csv. Inside this csv I have a field 'first name' with some Thai characters, so I set the type as utf8 in my sql table. To dump the csv I'm using this command line:

mysql -hlocalhost -uroot -p***** --default-character-set=utf8 TH -e "
load data local infile
'/home/tom/th_customer.csv'
into table customer
fields terminated by ','
lines terminated by '\n'
ignore 1 lines
"

But instead of getting the Thai characters, I just have ???? any suggestion please?

woshitom
  • 4,811
  • 8
  • 38
  • 62

1 Answers1

0

Try issuing these commands before the LOAD command:

set session collation_database=utf8_general_ci;
set session character_set_database=utf8;
Reuben L.
  • 2,806
  • 2
  • 29
  • 45