MySQL Text File Import and batch processing mode application instructions. For more information, see.
MySQL Text File Import and batch processing mode application instructions. For more information, see.
1. Load records in text files into mysql database tables
(1) Text File Format: one record per line. The field values are separated by the tab operator. The field order is the same as the order in the table definition. The uncertain field values are represented by \ N;
(2) load data local infile 'pet.txt 'into table pet;
Note: If the windows Editor is used, use:
Load data local infile 'pet.txt 'into table pet
Lines terminated by '\ r \ n ';
Run mysql in 2 mode
(1 put the mysqlsyntax to be run in a batch file batch-file.txt;
(2) Execution: mysql-h host-u user-p <batch-file.txt;
(3.txt redirects the output to the out.txt file:
Mysql-h host-u user-p <batch-file.txt> out.txt;
Run the script from the mysql prompt:
Mysql> source batch-file.txt; or mysql> \. batch-file.txt;