使用kettle操作mysql前注意要配置mysql-connector-java-5.1.38.jar到data-integration\lib下,然后重启下kettle(Spoon.bat)
现在要把一张表里的数据导到另一张表里
mysql> create table stu1(id int,name varchar(20),age int);
Query OK, 0 rows affected (0.01 sec)
mysql> create table stu2(id int,name varchar(20));
Query OK, 0 rows affected (0.01 sec)
mysql> insert into stu1 values(1001,'zhangsan',22)
-> ;
Query OK, 1 row affected (0.01 sec)
mysql> insert into stu1 values(1002,'lisi',23);
Query OK, 1 row affected (0.00 sec)
mysql> insert into stu1 values(1003,'xiaohua',21);
Query OK, 1 row affected (0.00 sec)
mysql> insert into stu2 values(1001,'hanmeiemi');
Query OK, 1 row affected (0.01 sec)
双击表输入进行编辑
增加一个插入/更新,按shift把两表用一个箭头连接
设置插入/更新的配置信息
执行
更新完成