The field table is not specified, So load data infile expects the input row to contain a field for each table column. Use the default fields and lines values.
If you want to load only some columns of a table, specify a field table:
Mysql tutorial> load data infile 'persondata.txt'
Into table persondata (col1, col2 ,...);
If the field order in the input file is different from the column order in the table, you must specify a field table. Otherwise, mysql cannot know how to match the input fields and columns in the table.
If a row has very few fields, it is set as the default value for columns without input fields.
Select <columns>
From <table_name>
Into outfile <file_name>
Select
Employee. id,
Employee. first_name,
Employee. last_name,
Employee. start_date,
Employee. salary,
Employee. city
From employee into outfile 'C: employee.txt ';
Import
Load data infile 'file_name.txt'
Into table tbl_name (field1, field2. .. etc)
Load data infile 'C: employee.txt'
Into table employee (id, first_name, last_name, start_date, salary, city );
Import from File
Mysql> load data local infile 'C: mytable.txt 'into table mytable lines terminated by 'rn ';
Mysql>