This article shares the specific code of importing CSV files into MySQL using Navicat for your reference. The details are as follows.
1. Open navicat, connect to the database and find the tables you want to import. The database table is under the table under the specified database.
2. Right-click on the data sheet. Click import wizard.
3. Choose the file type to import data. This paper takes the CSV file as an example and selects the CSV file.
4. Next, select the location of the file. You can click the ellipsis number after the first empty input box, and you can locate your files by browsing the file system. The encoding below chooses the same encoding as your file.
5. The first option is record partitioning. You can use the default, the second option is field separator, and the CSV file is default.
6. The field name row represents the location of the field name, usually the first line. The first data row represents the location of the first data, the row without a field name is 1, and the row with a field name acts 2.
last data rowRepresents the location of the last data. If only the first number of data can fill in the location of the last data here, if this is empty, all data will be imported by default. Below is the formatting.
date orderThe date indicates the position of the middle-aged month and day.
YExpressing the year,
MExpressing the month,
DThe selection here is based on your own documents.
date delimiterRepresents the divider in the date,
time delimiterRepresents the separator in the time display. The default can be used below. For example, in my file
7. The source table represents the location of the data storage, and the target table represents the table of the imported data.
8. Represents the flow of data, and the user_id data in the source table is imported into the user_id of the target table.
9. There are two ways to import data, one for
appendRepresents adding data after an existing record. The other is
copyRepresents deleting existing data and then adding data.
10. ClickstartStart execution.
The above is the whole content of this article. I hope it will be helpful to everyone’s study, and I hope you will support developpaer more.