Im having problems with LOAD DATA LOCAL INFILE loading a utf8 file. The Query looks like this:
LOAD DATA LOCAL INFILE 'file.csv' INTO TABLE artikel CHARACTER SET UTF8
FIELDS TERMINATED BY ';' ENCLOSED BY '"' LINES TERMINATED BY '\r\n';
But fields with special characters like "Dämmung" will be cut to "D".
SHOW VARIABLES LIKE '%_set_%';
Shows that it's all set to utf8, and I even used notepad++ to make sure the file is utf8.
It would really help, if someone knows advice, it's a huge file and I would like to avoid entering the wrong fields manually :-/
As the name suggests, varchar means character data that is varying. Also known as Variable Character, it is an indeterminate length string data type. It can hold numbers, letters and special characters.
For the mysql client, local data loading capability is determined by the default compiled into the MySQL client library. To disable or enable it explicitly, use the --local-infile=0 or --local-infile[=1] option. For the mysqlimport client, local data loading is not used by default.
The LOAD DATA INFILE statement reads rows from a text file into a table at a very high speed. If the LOCAL keyword is specified, the file is read from the client host. If LOCAL is not specified, the file must be located on the server.
I was having the same problem. There is a "hack" that solves this: maitain everything with UTF8. The exception is with the "LOAD DATA LOCAL....". When I use LATIN1 instead of UTF8 it works fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With