Exporting Data : Import Export Data « MySQL Utilities « MySQL Tutorial






The command to export data to a text file is similar to the standard SELECT command.

MySQL creates a 'tab delimited' file by default.

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';








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