I am trying to import an ASCII fixed length data file into mysql. I have PHPmyAdmin that I am using the console to try and load the file. (I have also tried using the "Import" tab, but that also is not reading the file correctly. I create a Database, then in the database I create a table using:
CREATE TABLE CountyCodeFile (
CountyCodeFile_County_Code CHAR(2) not null PRIMARY KEY,
LOAD DATA INFILE '/var/lib/mysql-files/countycd.lst' INTO TABLE CountyCodeFile FIELDS TERMINATED BY '' ENCLOSED BY '' ESCAPED BY '';
I get an error:
#1262 - Row 1 was truncated; it contained more data than there were input columns
The first two lines of the file to be inputed is:
I am working on a Linux (Mint) computer but the files came from our State's Election Board in ASCII format. I got it working 4-6 years ago but I had problems before it finally "worked" back then.
I have other similar tables and data that have the same problem.