Search code examples
mysqlmysql-workbenchload-data-infile

MySQL load data infile ; incorrect string value error


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


Solution

  • 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