You have to remember a few things to successfully import .csv files in the database from phpmyadmin. Save your Excel file as a csv file. Please Do not save it as a workbook or any other format, check it with a text reader such as notepad or similar. You can see that each column is separated by a comma (,). This is required when we import the file with PHPmyAdmin. Please remove column headings, blank areas and ensure that there is an entry of some form in each row and column. The data in the table should represent identically in the CSV file. If your table has ‘n’ columns you must have ‘n’ columns in the CSV file as well.
Follow the below steps in order to import .CSV file into database.
1. Upload .csv file in public_html via ftp.
2. Access your phpmyadmin >> Select database >> Click on SQL tab.
3. Type following SQL query.
load data local infile ‘Full path for .CSV file’ into table city
fields terminated by ‘,’
enclosed by ‘”‘
lines terminated by ‘\n’
Replace actual full path with “Full path for .CSV file” (/home/username/public_html/filename.csv)