Load data to your table : Import Export Data « MySQL Utilities « MySQL Tutorial






Create a text file myTable.txt containing one record per line.

The values are separated by tabs.

The order should be consistant with the columns listed in the CREATE TABLE statement.

For NULL values, use \N (backslash, capital-N).

For example:

1        firstName    lastName    M      \N      1997-12-09

To load the text file myTable.txt into the myTable table, use this command:

mysql> LOAD DATA LOCAL INFILE 'c:\\myTable.txt' INTO TABLE myTable LINES TERMINATED BY '\r\n';


mysql>








26.2.Import Export Data
26.2.1.Turn Exporting and Importing Data on
26.2.2.Exporting Data
26.2.3.Importing data
26.2.4.Load data to your table
26.2.5.LOAD DATA INFILE into a table