Home  >  Article  >  Database  >  How to import excel into phpmyadmin

How to import excel into phpmyadmin

(*-*)浩
(*-*)浩Original
2019-12-09 11:58:103942browse

How to import excel into phpmyadmin

1. The first step is to get an excel table, which contains a lot of data that we need to import.

2. Delete the first line of "Admission Ticket Number" and "XXX".... Only keep the data we need. (Recommended learning: phpmyadmin tutorial)

3. Click "File"--"Save As", select the type as "CSV (comma separated) (*.csv)", and save Save excel table as csv document. No matter what the prompts are in the middle, just say "yes"...

4, Key points! The slyar.csv saved as can be opened with a text editor such as Notepad or Editplus. 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 ",". Since it is a txt document, it involves the issue of file encoding! The default file encoding saved is ANSI. If your database (data table) uses UTF-8 encoding, then be sure to save this csv file as UTF-8 format!

5, 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. Too simple, no screenshots.

6, Open the table you created in phpMyAdmin and click "Import" at the top.

7, "Format of import file" select the second "CSV using LOAD DATA".

8. "File to import" select the csv file you just saved as.

9. Change the "field separator" to ",", which is the default selection of "(comma separated)" when saving in excel. You can freely choose the delimiter, which usually appears in your excel table data. ","in the case of.

10. "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, and no extra data is needed.

10. If there is no problem, you can press "Execute".

11, "Import successful, 1 query executed." Seeing this means success. If the import is unsuccessful, please carefully read this article and redo it from beginning to end.

The above is the detailed content of How to import excel into phpmyadmin. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn