
LINES TERMINATED BY – Use this line to specify the code for a line break.ENCLOSED BY – This specifies that a double-quote mark " surrounds values.If your export file uses a different delimiter, you can modify this value.


Change the path (between the quotes) to match the path and filename of your CSV file. LOAD DATA INFILE – Defines the location of the CSV file to be imported.Let us, in turn, explore the actions behind each of these lines: Import the data from the CSV file into the MySQL database, using the following lines: LOAD DATA INFILE '/home/export_file.csv' Visit the official MySQL documentation on data types to find out more. You can add, delete, or modify the data types used in this example to fit your needs. column_4 is formatted for whole numbers.The numbers in the parentheses indicate the maximum size of the value and the decimal places. In this example, column_1 is formatted for text.The column_n variable represents the names for each column in your CSV file, and you should edit them accordingly. Replace the table_name value with the name you want to use for your table. Use the following command to create a new table: CREATE TABLE table_name ( Replace database_name with the name of the database you are importing data into. Select a database by entering the following command: USE database_name If you already have a table ready for the CSV import, you can skip to Step 3 of the tutorial. The columns in your MySQL table need to match the data from the CSV file you plan to import. Step 2: Create MySQL Table for CSV Import
