Importing and Exporting Hundreds of Thousands of Rows in MySQL

When you need to insert or export very large amounts of data in MySQL, you can use the following statements:

# Import
load data infile '/path/file_name.txt' into table table_name;
# Export
SELECT * FROM table_name INTO OUTFILE '/path/out_file.txt';

For detailed usage and principles, refer to the official manual. Essentially, the data is a tab-separated text file, which makes it relatively easy to process.