在sqoop测试的时候遇到了连接不上的问题
sqoop测试命令
sqoop list-databases --connect jdbc:mysql://172.8.10.0:3306/?autoReconnect=true --username username --password password
如果报以下错误
ERROR manager.CatalogQueryManager: Failed to list databases com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
是少了jar包,把mysql-connector-java.jar 5和8版本都放到了sqoop的lib文件里,不知道缺哪个,反正都放进去就解决了
https://mvnrepository.com/artifact/mysql/mysql-connector-java/5.1.37
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.15?__cf_chl_f_tk=3siKHYKljMK0Q44MKad784Jfilwk.k2I6ibv4xWiDpY-1642410213-0-gaNycGzNDCU
还有一些别的错误,如权限问题,MySQL不能远程连接;还有提示缺少jar包,那就很幸福了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)