0

I am using MySQL workbench to create database from EER diagram (forward engineering), and want to load data from a text file to my table

load data infile 'c:\\actors.txt' ignore into table actors field terminated by '\t';

the file contains European characters. I have tried utf16,utf8,latin1,latin2 character sets for my database but still receiving error incorrect string value '\xE4vel'. I have dropped schema and created each time with different character set (all tables have correct collate according to character set). my os is windows7 64bit if it makes any difference! any one can help me. thanks

2 Answers 2

1

Have you tried using

LOAD DATA LOCAL INFILE?

Also, I don't know what is with the random Ignore after your file location.

For instance, you would just add the word LOCAL after Data, and take out the ignore. Try this:

LOAD DATA LOCAL INFILE 'c:\\actors.txt' into table actors field terminated by '\t';
Sign up to request clarification or add additional context in comments.

4 Comments

that ignore works kinda like local , ignores errors (doesn't stop loading) and continue the rest. I tried local and still the same problem, all the special characters are replaced by ? in the database
Hmmm, very strange. Special characters as in what? And what are you going to use this data as later? You might need to transfer the special characters to HTML code, save it like that, then when using it, transfer it back.
characters like ö,ä,å,á,Ó,... this is a simple movie database with tables of actors directors writers producers and ...
Try using mysqli_real_escape_string(), so for instance, mysqli_real_escape_string($data)
0

I managed to fix it , it seems that workbench (at least in my case) does not define charset and collate of each column in tables as it is defined in the database and you should do it manually!! for example if you set your database charset latin1 and collate latin1_swedish_ci each field in each table still remains empty of charset and collate , I had to go 1 by 1 to my tables and set the columns charset ! I dont know if it is the problem of forward engineering or what ? any way it solved

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.