I export a CSV-File in UTF-8 with Java. The char the fields are terminated by is the micro-symbol. As result MySQL imports the whole csv-line into the first table-field.
$sql = "LOAD DATA LOCAL INFILE 'C:/file.mysql'"
. " INTO TABLE `test`"
. " CHARACTER SET 'utf8'"
. " FIELDS TERMINATED BY 'μ'"
. " LINES TERMINATED BY '
'";
The databases encoding is utf8. I tried mysql_query("SET NAMES 'utf8'", $con); mysql_query("SET CHARACTER SET 'utf8'", $con); mysql_set_charset('utf8', $con);
before the load-data-query.
I tried also setting "|" as field-terminator. That works well.
//edit: It also works fine with SQL Server (mssql)