Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps for mysql to import excel data

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the steps of importing excel data into mysql, which is very detailed and has certain reference value. Friends who are interested must finish reading it!

To import excel data from mysql:

1. In the first step, we get an excel table with a lot of data we need to import.

2. Delete the first line "admission card number" and "XXX". Keep only the part of the data we need.

3. Click "File"-"Save as", select the type "CSV (comma separated) (* .csv)", and save the excel table as an csv document. It would be nice to be "yes" no matter what the hint is in the middle.

Highlight! Slyar.csv saved as can be opened with a text editor such as notepad or Editplus. Let's open it and have a look.

You can see that csv documents are actually txt (that is, you can use your own txt and change the suffix name), but separate the fields with ",". Since it is an txt document, it involves the issue of file encoding! The default saved file encoding is ANSI, and if your database (datasheet) uses UTF-8 encoding, be sure to save the csv file in UTF-8 format!

4. Go to phpMyAdmin to create a table and create a new field with the field name associated with the excel field you want to import in the same order. It's too easy to take screenshots.

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

6. "Import file format" Select "CSV uses LOAD DATA".

7. "File to Import" Select the csv file you just saved as.

8, "Field Delimiter" changed to ",", that is, excel saved as the default choice of "(comma delimited)", you are free to choose the delimiter, usually 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 represents the field you want to fill in, separated by ",". If it is empty, it means that it is all filled, and it is filled in order, and the excess data is not needed.

11. if there is no problem with the inspection, you can press "execute".

12. "Import succeeded and 1 query was executed". If you see this, it's a success.

The above are all the steps for mysql to import excel data. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report