import export
suggest changeExport. The file is written on the server host, and the account needs the FILE privilege:
SELECT a, b, c INTO OUTFILE 'result.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM table_name;
Import. LOAD DATA reads a file on the server. LOAD DATA LOCAL reads a file on the client:
LOAD DATA INFILE 'result.txt' INTO TABLE table_name
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents