Home >Database >Mysql Tutorial >How to import text into mysql

How to import text into mysql

coldplay.xixi
coldplay.xixiOriginal
2020-11-03 10:25:097078browse

How to import text into mysql: first create the table, right-click and select the import wizard, select the format of the text file [.txt]; then select the path and encoding [utf-8], and select the delimiter; then select Title, click Next; finally click Start Import.

How to import text into mysql

More related free learning recommendations: mysql tutorial(video)

How to import text into mysql:

1. The first step is to open mysql on our computer, create a new database and a table, and the fields designed in the table need to be listed with the imported text document Number corresponding, which field corresponds to which column of the txt text document, as shown in the following figure:

How to import text into mysql

2. After creating the table in the second step, right-click the table and select Import Wizard, as shown in the figure below:

How to import text into mysql

3. In the third step, after entering the import wizard interface, select the format of the imported text file .txt and click Next, as shown in the figure below Display:

How to import text into mysql

4. The fourth step is to 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:

How to import text into mysql

5. The fifth step is to select the delimiter. This means to distinguish each column of the text document by comma, semicolon or space. The choice here is to distinguish by space. Click next One step, as shown in the figure below:

How to import text into mysql

6. Step 6: Select which row the list title is and which row the first data row is. Select 1 here and click The next step is as shown in the figure below:

How to import text into mysql

7. In the seventh step, click Next by default. The source table here refers to the txt text document, and the target table is to import data. The database table, as shown below:

How to import text into mysql

8. The eighth step will display the fields of the database table by default, and you need to select it from the source field, which is the txt text document. Select the corresponding column. After selecting, click Next, as shown in the following figure:

How to import text into mysql

9. In the ninth step, select the import mode and select Add: Add records to Target table, click Next, as shown in the following figure:

How to import text into mysql

10. Step 10: Go to the last step of importing the txt text document, click to start importing, and wait for a while to import. When finished, click Close and open the database table. You can see that the txt text document data has been imported, as shown in the figure below:

How to import text into mysql

The above is the detailed content of How to import text into mysql. 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

Related articles

See more