Error Code: 1300. Invalid utf8mb4 character string - mysql

I have created a table from a csv file using built in mysql workbench wizard.
The structure was created and also 3 test rows were imported into the table.
Now I wanted to use the very same csv which i used to create the table in the first place and load the same 3 rows once again but using the LOAD DATA INFILE command.
I am getting error code: 1300. The string field contains german ü characters which I assume are the problem but why ? The column already contains string values with those characters.
screenshot

Related

AbInitio Input Table won't read Special UTF-8 Characters

I have a simple AbInitio Graph that loads an input table from a mysql DB into another output table on a snowflake DB to sync the two.
I have a .read.dml file where one line is:
utf8 string("\x01") name /*VARCHAR(255) NOT NULL*/;
When the graph is run it loads data with special characters like this:
original: Vidéo
abinitio loaded: Vid\Xe9o
This is causing of course the output table to reject any records with this '\X' interpretation. How can I resolve this?

Importing CSV data into a table in mySQL database

Ok so I am trying to import data from a CSV file into mySQL database table. The table is called serial_code, however when I try to upload the CSV file I have an error message. I have tried taking the column names out, also adding NULL to the last column EngineSerialCode and I have also viewed the CSV in a text editor and it shows the columns correctly with , comma.
Invalid column count in CSV input on line 1.
Version of phpMyAdmin and mySQL
Database Fields
CSV Fields I want to import
Ok so I found the issue and it was quite frustrating. I had a serial code in my data that had a "," comma instead of a "-". Also I noticed that my CSV file EngineSerialCode was placed in column E and not D as I only have 4 columns in my database. From the image column C is overlapping column D hence my mistake.

How to insert greek text in my sql db through PhpMyAdmin

i'd like to ask a question that's been bothering me for some days now.
I have a mysql db with one table concisted of 38 cells.
Among those cells 2 of them are expecting greek text in them (FIRSTNAME and LASTNAME).
The table and each cell are formatted in utf8-general-ci
Cause the table will be filled with thousand of rows every month, i have a selected to populate it by incerting a csv file created in excel (csv file with commas).
The problem is that it won't allow the greek text to populate those 2 cells, returning the following answer:
1366 - Incorrect string value: '\xCC\xC1\xCC\xC1\xD3' for column 'lastname' at row 1
Does anyone have any suggestion on what to do????
In phpMyAdmin when you choose a table then Import you will se an option like "Charset file" (in greek version of phpMyAdmin it is "Σύνολο χαρακτήρων του αρχείου") you must select utf-8.
If it doesnt work then check your csv file if the greek characters is fine or not then you must check the exporting method.

MySQL CSV importing error: Invalid column count

I get an invalid column count error while trying to import from a ; delimited CSV to MySQL via phpMyadmin. The error is possibly caused by the ; signs in the HTML text such as é. What should I do?
The records contained <pre> texts in coding-related articles, so I had to remove [CR] and [LF] chars (they were interpreted as new lines => new record), plus I had to replace ; in html entities with something else, so now column count matches and the import was successful. Converting back the replace text to ; everything works now.

How can I load 10,000 rows of test.xls file into mysql db table?

How can I load 10,000 rows of test.xls file into mysql db table?
When I use below query it shows this error.
LOAD DATA INFILE 'd:/test.xls' INTO TABLE karmaasolutions.tbl_candidatedetail (candidate_firstname,candidate_lastname);
My primary key is candidateid and has below properties.
The test.xls contains data like below.
I have added rows starting from candidateid 61 because upto 60 there are already candidates in table.
please suggest the solutions.
Export your Excel spreadsheet to CSV format.
Import the CSV file into mysql using a similar command to the one you are currently trying:
LOAD DATA INFILE 'd:/test.csv'
INTO TABLE karmaasolutions.tbl_candidatedetail
(candidate_firstname,candidate_lastname);
To import data from Excel (or any other program that can produce a text file) is very simple using the LOAD DATA command from the MySQL Command prompt.
Save your Excel data as a csv file (In Excel 2007 using Save As) Check
the saved file using a text editor such as Notepad to see what it
actually looks like, i.e. what delimiter was used etc. Start the MySQL
Command Prompt (I’m lazy so I usually do this from the MySQL Query
Browser – Tools – MySQL Command Line Client to avoid having to enter
username and password etc.) Enter this command: LOAD DATA LOCAL INFILE
‘C:\temp\yourfile.csv’ INTO TABLE database.table FIELDS TERMINATED
BY ‘;’ ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘\r\n’ (field1, field2);
[Edit: Make sure to check your single quotes (') and double quotes (")
if you copy and paste this code - it seems WordPress is changing them
into some similar but different characters] Done! Very quick and
simple once you know it :)
Some notes from my own import – may not apply to you if you run a different language version, MySQL version, Excel version etc…
TERMINATED BY – this is why I included step 2. I thought a csv would default to comma separated but at least in my case semicolon was the deafult
ENCLOSED BY – my data was not enclosed by anything so I left this as empty string ”
LINES TERMINATED BY – at first I tried with only ‘\n’ but had to add the ‘\r’ to get rid of a carriage return character being imported into the database
Also make sure that if you do not import into the primary key field/column that it has auto increment on, otherwhise only the first row will be imported
Original Author reference