Import delimited files efficiently.
Section: imports, exports, and mysql shell utilities
Load CSV data into a table
sql
sql
LOAD DATA INFILE '/var/lib/mysql-files/users.csv'
INTO TABLE users_staging
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(email, full_name);Explanation
Much faster than many single-row inserts for bulk imports.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing imports, exports, and mysql shell utilities
Import delimited text with mysqlimport
Use the mysqlimport command-line utility.
Dump an instance with MySQL Shell
Use MySQL Shell utilities for scalable dumps.