The following describes two methods for importing excel Data to the mysql database. These two methods are simple and convenient, in the past, I used php programs to import excel Data to mysql databases. Now we don't need a program, just use the existing tools.
The following describes two methods for importing excel Data to mysql: Database tutorial. These two methods are simple and convenient, in the past, I used php Tutorial programs to import excel Data to mysql databases. Now we don't need a program, just use the existing tools.
Method 1: Use phpmyadmin to import excel Data to the mysql database as follows:
This is an excel file. It must look like this.
The format of the phpmyadmin import file should be as configured. (Note that the structure of the imported excel table must be consistent with that of the mysql DATA table and the data type. Otherwise, the Import fails.
Method 2: generate an excel file. The SQL file is OK.
1. In the last column of the data to be imported, write an excel Formula as follows:
= Concatenate ("insert into employee (name, birthday, email, Hober) 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 (do not forget to delete the "SQL" in the first line ").
Note: if there is a date, modify the formula.
= Concatenate ("insert into employee (name, birthday, email, Hober) values ('", rc [-4], "', '", text (rc [-3], "yyyy-mm-dd hh: mm: ss"), "','", rc [-2], "','", rc [-1], "');")