Here we want to talk about two kinds of Excel data into the MySQL Tutorial database tutorial methods, these two methods are relatively simple, is also very convenient, before I put the Excel data into the MySQL database is a PHP tutorial program to instance, now we do not need a program, with existing tools on the line.
Method one, using phpMyAdmin to import Excel data into MySQL database method is as follows
This is Excel and must be the way it is.
The format of the phpMyAdmin import file should be configured as shown above. (Note that the structure of the imported Excel table must be the same as the structure of the MySQL datasheet, the data type, etc.) OK. Otherwise, the failed import will be imported.
Method Two, the Excel file is generated. sql file OK
1. In the last column of data that you want to import, write an Excel formula, as follows
=concatenate ("INSERT into employee (name,birthday,email,hobby) VALUES ('", rc[-4], "', '", rc[-3], "', ', rc[-2]," ', ' ", RC [-1], "');"
2. Select the last column, copy the data to a text file, and save the text file as a. sql file (don't forget to delete the first row of "SQL").
Note: If there is a date, modify the formula
=concatenate ("INSERT into employee (name,birthday,email,hobby) VALUES ('", rc[-4], "', '", Text (rc[-3), "Yyyy-mm-dd hh:mm : ss ")," ', ', ' ", rc[-2]," ', ' ", rc[-1]," ');