First we got an excel table, which contains a lot of data that we need to import
Delete the first row "id" "XXX"....field rows, only keep the data part we need
Click "File"--"Save As", and select the type as "CSV (comma separated) (*.csv) ", save the excel table as a csv document. (Select "OK" for all subsequent prompts)
The ee.csv saved as can be opened with a text editor such as Notepad or notepadd. Let's open it and take a look. . You can see that the csv document is actually txt (that is, you can use your own txt and then change the suffix name), but the fields are separated by ","
Enter phpMyAdmin to create a table, create a new field, and the field names are related to the fields of the excel table you want to import and in the same order.
Open the table you just created in phpMyAdmin and click "Import" at the top.
"Import file format" select the second "CSV using LOAD DATA".
"File to import" select the csv file you just saved as.
"Field separator" is changed to ",", which is the default selection of "(comma separated)" when saving excel. You can freely choose the separator, which usually appears in your excel table data with "," "in the case of.
"Field name" is an advanced application. The field name here is the field name in your data table. It indicates the field you want to fill in. Multiple fields are separated by ",". Empty here means filling everything in order. Do not
with excess data and click "Execute".
Afterwards it prompts "The import is successful, you can open the table to view the data import has been successful
Recommended related article tutorials: phpmyadmin tutorial
The above is the detailed content of How does phpmyadmin batch import excel data into mysql?. For more information, please follow other related articles on the PHP Chinese website!