使用datax做mysql到mysql的数据迁移 报错Field 'body' doesn't have a default value和其它 求解决思路或具体方法-问答-阿里云开发者社区-阿里云

开发者社区> cctv531529> 正文

使用datax做mysql到mysql的数据迁移 报错Field 'body' doesn't have a default value和其它 求解决思路或具体方法

2016-06-15 19:08:21 6309 2

环境和配置说明:
1、2台mysql之间做迁移
2、在mysqlreader端部署了datax,然后希望能迁移到writer端。
3、2台服务器上mysql已经互相开放权限且网络正常,能连接成功。
4、reader端是lamp环境 ,writer端为wamp环境 。
5、datax配置信息如下:
{

"job": {
    "content": [
        {
            "reader": {
                "name": "mysqlreader",
                "parameter": {
                    "username": "root",
                    "password": "123",
                    "column": ["id","name","body","url","listurl","detailurl","demo","status","listbegin","listend","listitempat","musthave","listurlpat","listurlreplace","nohave","listtype","curlPost","pagename","detailmust","detailno","ifhandleadd","ifallok","updatezq","daarea","area","province","city","qu","money","zhuti","lxglf","time_duan","is_fenduan","tel_to","dizhi","re_dizhi","start_line_time","end_line_time","end_for","is_tongji"],
                    "splitPk": "id",
                    "connection": [
                        {
                            "jdbcUrl": ["jdbc:mysql://192.168.1.124:3306/dla"],
                            "table": ["lzh_sitelist"]
                        }
                    ],
                    "where": "id<3000"
                }
            },
            "writer": {
                "name": "mysqlwriter",
                "parameter": {
                    "writeMode": "insert",
                    "username": "root",
                    "password": "123",
                    "column": ["id","name","body","url","listurl","detailurl","demo","status","listbegin","listend","listitempat","musthave","listurlpat","listurlreplace","nohave","listtype","curlPost","pagename","detailmust","detailno","ifhandleadd","ifallok","updatezq","daarea","area","province","city","qu","money","zhuti","lxglf","time_duan","is_fenduan","tel_to","dizhi","re_dizhi","start_line_time","end_line_time","end_for","is_tongji"],
                    "connection": [
                        {
                            "jdbcUrl": "jdbc:mysql://192.168.1.128:3306/dla",
                            "table": ["lzh_sitelist"]
                        }
                    ],  
                }
            }
        }
    ],
    "setting": {
        "speed": {
            "channel": "2"
        }
    }
}

}
故障报错:
1、中途有报错 Field 'body' doesn't have a default value 。
2、之后插入时部分数据插入成功 还有部分数据报错 脏数据... 报错截图如下
1

取消 提交回答
全部回答(2)
  • 木洛
    2019-07-17 19:40:04

    这个错误是「duplicate entry」,也就是说通过DataX写mysql表的时候,mysql报了这个错误,原因是有重复的primary key。
    具体如何解决的话,可以google下duplicate entry when insert data into mysql.

    0 0
  • cctv531529
    2019-07-17 19:40:04

    补充:本来准备用datax将青岛的ECS上mysql迁移到我的ADS上的,所以用datax做了mysql到mysql的初步测试,可是...


    论坛admin管理员,这不是阿里的技术讨论社区么?怎么一个question抛出去一点回应都没有,还不如工单来得实在....


    社区管理员,这社区提问有什么规则或者要求么?为何我的问题无人回答?

    0 0
添加回答
相关问答

17

回答

【大咖问答】对话PostgreSQL 中国社区发起人之一,阿里云数据库高级专家 德哥

阿里ACE 彭飞 2019-07-10 09:36:10 965366浏览量 回答数 17

162

回答

惊喜翻倍:免费ECS+免费环境配置~!(ECS免费体验6个月活动3月31日结束)

豆妹 2014-10-29 17:52:21 222960浏览量 回答数 162

145

回答

【新手入门】云服务器linux使用手册

fanyue88888 2012-11-26 17:14:18 157062浏览量 回答数 145

8

回答

OceanBase 使用动画(持续更新)

mq4096 2019-02-20 17:16:36 333833浏览量 回答数 8

110

回答

OSS存储服务-客户端工具

newegg11 2012-05-17 15:37:18 292255浏览量 回答数 110

22

回答

爬虫数据管理【问答合集】

我是管理员 2018-08-10 16:37:41 146765浏览量 回答数 22

18

回答

阿里云开放端口权限

xcxx 2016-07-20 15:03:33 643075浏览量 回答数 18

38

回答

安全组详解,新手必看教程

我的中国 2017-11-30 15:23:46 256853浏览量 回答数 38

249

回答

阿里云LNAMP(Linux + Nginx + Apache + MySQL + PHP)环境一键安装脚本

云代维 2014-02-14 15:26:06 302579浏览量 回答数 249

2

回答

区域选择帮助

fanyue88888 2012-12-07 15:54:30 203994浏览量 回答数 2
+关注
0
文章
4
问答
推荐问答
相关电子书
更多
文娱运维技术
立即下载
《SaaS模式云原生数据仓库应用场景实践》
立即下载
《看见新力量:二》电子书
立即下载