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

The method of importing text data by mysql

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

Share

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

This article is about how mysql imports text data. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

Methods: 1, use navicat to create a new data table, pay attention to the corresponding columns of txt data; 2, right-click the table, select the import wizard; 3, select the import type to select "txt"; 4, select the path of the import file, code to select utf-8;5, select the separator, import mode is "add."; 7, click to start import, waiting for the import to be completed.

Sometimes when we use a mysql database, we want to import txt text documents. What do we do? The following article introduces how to import txt text data into mysql.

Prerequisites:

Install mysql and navicat

The method of importing txt text data into mysql

The first step is to open mysql using navicat on our computer, and create a new database and a table. The fields designed in the table need to correspond to the number of columns of the imported text document, and which field corresponds to which column of the txt text document, as shown below:

After the table is created in the second step, right-click the table and select the Import wizard, as shown in the following figure:

After entering the import wizard interface in the third step, select the format of the import text file .txt, and click next, as shown in the following figure:

Step 4: select the path of the txt text document to be imported, select utf-8 for encoding, and click next, as shown in the following figure:

The fifth step is to select the delimiter, which means to distinguish each column of the text document by comma, semicolon, space, etc. Here, select by space, and click next, as shown in the following figure:

Step 6: select which row is the title of the list and which row is the first data row. Select 1 here, and click next, as shown in the following figure:

Step 7: click next by default. Here, the source table refers to the txt text document, and the target table is the database table to import data, as shown in the following figure:

Step 8 displays the fields of the database table by default. You need to select the corresponding column from the source field, that is, the txt text document. After selecting it, click next, as shown in the following figure:

Step 9: select the imported mode, and select add: add records to the target table, and click next, as shown in the following figure:

Step 10: go to the last step of importing txt text document, click start Import, wait for the import to be completed, click close, open the database table, and you can see that the txt text document data has been imported, as shown in the following figure:

Thank you for reading! This is the end of the method of importing text data into mysql. I hope the above content can help you to some extent, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

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