当前位置: 首页 > article >正文

sqoop连接MYSQL报错处理

Sqoop远程连接MYSQL数据库报/apache/commons/lang/StringUtils错误,如下:

[root@manager ~]# sqoop list-databases --connect jdbc:mysql://10.100.81.207:3306/ --username root --password 123
Warning: /home/bigdata/sqoop//../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /home/bigdata/sqoop//../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /home/bigdata/zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
2023-10-27 17:21:07,607 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
2023-10-27 17:21:07,637 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
2023-10-27 17:21:07,755 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
        at org.apache.sqoop.manager.MySQLManager.initOptionDefaults(MySQLManager.java:73)
        at org.apache.sqoop.manager.SqlManager.<init>(SqlManager.java:89)
        at com.cloudera.sqoop.manager.SqlManager.<init>(SqlManager.java:33)
        at org.apache.sqoop.manager.GenericJdbcManager.<init>(GenericJdbcManager.java:51)
        at com.cloudera.sqoop.manager.GenericJdbcManager.<init>(GenericJdbcManager.java:30)
        at org.apache.sqoop.manager.CatalogQueryManager.<init>(CatalogQueryManager.java:46)
        at com.cloudera.sqoop.manager.CatalogQueryManager.<init>(CatalogQueryManager.java:31)
        at org.apache.sqoop.manager.InformationSchemaManager.<init>(InformationSchemaManager.java:38)
        at com.cloudera.sqoop.manager.InformationSchemaManager.<init>(InformationSchemaManager.java:31)
        at org.apache.sqoop.manager.MySQLManager.<init>(MySQLManager.java:65)
        at org.apache.sqoop.manager.DefaultManagerFactory.accept(DefaultManagerFactory.java:67)
        at org.apache.sqoop.ConnFactory.getManager(ConnFactory.java:184)
        at org.apache.sqoop.tool.BaseSqoopTool.init(BaseSqoopTool.java:272)
        at org.apache.sqoop.tool.ListDatabasesTool.run(ListDatabasesTool.java:44)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:82)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 20 more

解决办法:
在apache 上下载commons-lang-2.6.jar包并上传到sqoop的lib下即可,下载地址:

点击下载


[root@manager ~]# sqoop list-databases --connect jdbc:mysql://10.100.81.207:3306/ --username root --password 123
Warning: /home/bigdata/sqoop//../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /home/bigdata/sqoop//../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /home/bigdata/zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
2023-10-27 17:28:17,875 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
2023-10-27 17:28:17,909 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
2023-10-27 17:28:18,032 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
Fri Oct 27 17:28:18 CST 2023 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
information_schema
hive
mysql

执行成功


http://www.kler.cn/a/106654.html

相关文章:

  • 浅谈React的虚拟DOM
  • git上传文件到远程仓库
  • 深度学习的多主机多GPU协同训练
  • linux病毒编写+vim shell编程
  • Android音视频直播低延迟探究之:WLAN低延迟模式
  • Docker在CentOS上的安装与配置
  • 基于PyTorch的MNIST手写体分类实战
  • Mac版好用的Git客户端 Fork 免激活
  • c# 操作word中的表格 批量复制和批量插入
  • 修改svc的LoadBalancer的IP引发的惨案
  • Nacos的安装和实操
  • 2023NOIP A层联测19-多边形
  • 基于nodejs+vue人脸识别考勤管理系统的设计与实现
  • 正点原子嵌入式linux驱动开发——Linux LCD驱动
  • day06-Flex布局
  • 微信小程序input输入字母自动转大写不生效问题解决
  • 一文搞懂 MineCraft 服务器启动操作和常见问题 2023年10月
  • CentOS卸载LVM磁盘的方法
  • centos格式化硬盘/u盘的分区为NTFS格式
  • 【网安大模型专题10.19】论文6:Java漏洞自动修复+数据集 VJBench+大语言模型、APR技术+代码转换方法+LLM和DL-APR模型的挑战与机会
  • 接口测试及接口测试常用的工具
  • nodejs+vue旅游推荐系统-计算机毕业设计
  • Spring的BeanFactory与FactoryBean的区别
  • MySQL - 为什么InnoDB选择B+树索引?Change buffer?
  • Docker 入门
  • 计算机网络重点概念整理-第二章 物理层【期末复习|考研复习】