Finally I found the solution.
Just short note for everybody who has problem with LOAD DATA INFILE and
correct charset of the file. Loaded file must have SAME charset as DATABASE
which contains target table of LOAD DATA command. Target table charset
doesn't matter. I didn't find any note about it in manual but I think it is
useful to know it.
----- Original Message -----
From: "Dušan Pavlica" <pavlica@stripped>
To: "list mysql" <mysql@stripped>
Sent: Monday, April 11, 2005 10:52 AM
Subject: Charset and LOAD DATA INFILE problem
I'm trying to convert tables from Paradox DBs to MySQL and I have a big
problem with setting correct character set. I created small application
which generates csv files which are in cp1250 (I can't change it, it's
charset ofmy Paradox DBs). My databases and tables in MySQL are in latin2. I
tried in MySQL client command SET NAMES cp1250 and then LOAD DATA INFILE but
that didn't help. Some chars were screwed up. If I create SQL script from
part of csv file and load it by command SOURCE 'script.sql' then everything
So, does anybody know the way how to import files from CSV directly by LOAD
DATA INFILE without difficult manual conversions to sql scripts?
Thanks in advance for any help or ideas.