You can load data from an external file into MySQL using the LOAD DATA INFILE command. The data in your file must be in a structured format—the default format is one record on each line, with values separated by tabs.
The file shown in Listing 15.1 contains a file that could be loaded into the products table using the following command:
LOAD DATA INFILE '/home/chris/listing15.1.txt' INTO TABLE products;
BLUE Blue product 3.0 13.99 RED Red product 3.5 25.00 GREEN Green product 4.5 6.50
If no path is given for the filename in LOAD DATA INFILE, MySQL looks for it in ...