1、编写read-mysql.json脚本
{
“job”: {
“setting”: {
“speed”: {
“channel”:1
}
},
“content”: [
{
“reader”: {
“name”: “mysqlreader”,
“parameter”: {
“username”: “用户名”,
“password”: “密码”,
“connection”: [
{
“querySql”: [
“select * from emp_base_info where emp_city_code=‘130100’;”
] ,
“jdbcUrl”: [
“jdbc:mysql://IP:3306/test”
]
}
]
}
},
“writer”: {
“name”: “streamwriter”,
“parameter”: {
“print”:true
}
}
}
]
}
}
2、执行脚本
/datax/bin/datax.py ./read-mysql.json