- First you need to prepare a excel,ps with data: The header corresponds to the field name in the database table:
- Then "File---> Save As. csv file"
- If you have Chinese in your data, then you need to process the CSV file, otherwise it will fail to import, with EditPlus or other editor (save can modify the encoding format of the editor), open the CSV file, save is to choose the encoding format of Utf-8, (PS: The encoding format of your database is also utf-8). under Mac We can use numbers to open the CSV file, and then choose the encoding format as utf-8 when exporting.
- Start the import, we can choose a MySQL graphical tool, I use Navicat for Mac
- Select the CSV file you just saved
- In particular, if you have a table header, change the column name row to 1 and the first line to 2.
- And then the next step until the import is successful.
Introduction to using the Navicat tool to import data from Excel into MySQL