Home >Database >Mysql Tutorial >How to import text data in mysql?
Method: 1. Use navicat to create a new data table, and pay attention to the columns corresponding to the txt data; 2. Right-click the table and select the import wizard; 3. Select "txt" as the import type; 4. Select the path to the import file. Select UTF-8 for encoding; 5. Select the delimiter and the import mode is "Add.."; 7. Click to start importing and wait for the import to complete.
(Recommended tutorial: mysql video tutorial)
Sometimes when we use mysql database, we want to import txt text document, how to operate it? The following article will introduce to you how to import txt text data into mysql.
Prerequisites:
Install mysql and navicat
Mysql method of importing txt text data
The first step is to use navicat to open mysql on our computer, 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, which field corresponds to which column of the txt text document, as shown in the figure below Display:
After creating the table in the second step, right-click the table and select the Import Wizard, as shown in the following figure:
The third step is to enter the import wizard interface, select the format of the imported text file .txt, and click Next, as shown below:
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 figure below:
The fifth step is to select the delimiter, which means press Use commas, semicolons or spaces to distinguish each column of the text document. The choice here is to distinguish by spaces. Click Next, as shown below:
The above is the detailed content of How to import text data in mysql?. For more information, please follow other related articles on the PHP Chinese website!