BULK INSERT in MySQL
Similar to the BULK INSERT command in MS SQL, MySQL provides the LOAD DATA INFILE command to perform bulk insertion operations.
Equivalent MySQL Command for BULK INSERT:
LOAD DATA INFILE
Syntax:
LOAD DATA INFILE 'filepath' INTO TABLE database_name.table_name FIELDS TERMINATED BY ','
Explanation:
Example:
To load data from a text file named MyTextFile.txt into a table named MyTable in the database myDatabase, use the following command:
LOAD DATA INFILE 'C:\MyTextFile.txt' INTO TABLE myDatabase.MyTable FIELDS TERMINATED BY ','
The above is the detailed content of How to Perform Bulk Inserts in MySQL?. For more information, please follow other related articles on the PHP Chinese website!