Use kettle to insert the text file content into the mysql table under the Linux Virtual Machine. kettlemysql
I. decompress the kettle package
1. Copy the package to Linux.
Mysql driver package
2. decompress the zip package
Enter the command: unzip/software/pdi-ce-7.0.0.0-25.zip
You can delete the original package.
Enter the command: rm-f pdi-ce-7.0.0.0-25.zip
2. Create databases and tables
3. insert data in text files into database tables
1. Write a text file
2. Drag a text file input and a table output in kettle
3. Right-click and select Edit to edit a text file.
Click Preview to select your text file
Click Add to add your text file to the selected file.
Edit content
Click to obtain Fields
Then confirm the completion, so that we can edit our text file.
4. Right-click the table output and select Edit steps.
Edit database connection
Host Name: Enter the IP address of your Linux Virtual Machine
Click test to check whether the connection is successful.
If the connection fails, check whether your mysql package has been exported to the virtual machine,
Is there an error in the Host Name?
Does the mysql service of Linux Virtual Machine start?
Does the firewall of Linux virtual machine turn off?
5. Click "run ".
6. Check whether the table in the virtual machine has been added to the data.
If there is data, it means OK.
4. Note
The field names in the text file must be the same as those in the table.