LOAD IN FILE in UTF8 format
Posted by: Fred Brun
Date: November 20, 2009 08:22AM

I want to load utf8 data text file in my database (MySQL 5.1.38).

This is my MySQL character configuration :
character_set_client;utf8
character_set_connection;utf8
character_set_database;utf8
character_set_filesystem;binary
character_set_results;utf8
character_set_server;utf8
character_set_system;utf8
character_sets_dir;C:\\Program Files\\MySQL\\MySQL Server 5.1\\share\\charsets\\

I create this file with C# progam like that :
StreamWriter streamTemp = new StreamWriter(new FileStream(@"\\myserver\KT_Export_UTF8.tmp", FileMode.CreateNew), Encoding.UTF8);

We I try to load the file with this command :
LOAD DATA INFILE 'KT_Export_UTF8.tmp' INTO TABLE datacontrol ;

I have always this message :
Error Code : 1452
Cannot add or update a child row: a foreign key constraint fails (`ipgkelenn`.`datacontrol`, CONSTRAINT `datacontrol_ibfk_2` FOREIGN KEY (`id_series`) REFERENCES `series` (`id_series`))

I try the same command with ASCII file, it run correctly.

So is somenone have a solution ?

Options: ReplyQuote


Subject
Views
Written By
Posted
LOAD IN FILE in UTF8 format
5177
November 20, 2009 08:22AM
2277
November 21, 2009 10:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.