List:General Discussion« Previous MessageNext Message »
From:Dušan Pavlica Date:April 11 2005 2:17pm
Subject:Re: Charset and LOAD DATA INFILE problem - solved
View as plain text  
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.

Dusan

----- 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


Hello,

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 
is OK.
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.

Dusan Pavlica 

Thread
Charset and LOAD DATA INFILE problemDušan Pavlica11 Apr
  • Re: Charset and LOAD DATA INFILE problem - solvedDušan Pavlica11 Apr