Hi ,follow these steps to insert your excel data into mysql table:
1. your excel file save it as YourFileName.csv(Common Delimited) format.Example: suppose your file contains slno,name and roll no of students then after saving it csv you will see it as
SLno,Name,RollNo
1,Shivam Pandey,100
2,Rohit Pandey,200
2.MySQL Table :
CREATE TABLE studentTable (
SLno INT NOT NULL AUTO_INCREMENT,
Name VARCHAR(255) NOT NULL,
RollNo INT NOT NULL,
PRIMARY KEY (RollNo)
);
3.Use this script to insert data( LOAD DATA INFILE ) :
LOAD DATA INFILE 'c:/users/queryhome/documents/studentDetails.csv'
INTO TABLE studentTable
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
first line that contains the column headings, which should not be imported into the table.