Sqoop MySQL 8 迁移至Hadoop 3 提示:java.sql.SQLException: The connection property ‘zeroDateTimeBehavior‘
Posted 在奋斗的大道
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Sqoop MySQL 8 迁移至Hadoop 3 提示:java.sql.SQLException: The connection property ‘zeroDateTimeBehavior‘相关的知识,希望对你有一定的参考价值。
今天尝试使用Sqoop 将mysql 8 中的数据迁移至Hadoop 3 提示如下错误信息:
2023-03-01 14:33:31,496 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLException: The connection property 'zeroDateTimeBehavior' acceptable values are: 'CONVERT_TO_NULL', 'EXCEPTION' or 'ROUND'. The value 'convertToNull' is not acceptable.
java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLException: The connection property 'zeroDateTimeBehavior' acceptable values are: 'CONVERT_TO_NULL', 'EXCEPTION' or 'ROUND'. The value 'convertToNull' is not acceptable.
解决:
sqoop import --connect "jdbc:mysql://192.168.43.10:3306/house?useSSL=false&serverTimezone=UTC&zeroDateTimeBehavior=CONVERT_TO_NULL" --username root --password 123456 --table base_house --target-dir '/sqoop/base-house' --fields-terminated-by ',' -m 1;
加了个参数zeroDateTimeBehavior=CONVERT_TO_NULL 即可解决上述问题。
以上是关于Sqoop MySQL 8 迁移至Hadoop 3 提示:java.sql.SQLException: The connection property ‘zeroDateTimeBehavior‘的主要内容,如果未能解决你的问题,请参考以下文章
Sqoop MySQL 8 迁移Hadoop 3 提示:master:9000/sqoop/base-house already exists