我正在尝试将 Sqoop 与 Mysql 连接起来。在问这个问题之前,我尝试了所有我搜索过的解决方案,但都没有奏效。
这就是我正在输入的内容
/usr/local/hadoop/sqoop/lib$ sqoop 列表数据库 --connect jdbc:mysql://localhost:3306/testDb --用户名 Amel --密码 > Amel@-1998;
我确实在 /usr/local/hadoop/Sqoop/lib/ 目录中安装了 SQLConnector。
它的名字是:mysql-connector-java_8.0.25-1ubuntu20.04_all.deb 我已经安装了.deb 文件
这是每次都会出现的错误。
Warning: /usr/local/hadoop/sqoop/../hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /usr/local/hadoop/sqoop/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /usr/local/hadoop/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /usr/local/hadoop/sqoop/../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
21/07/09 20:48:11 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
21/07/09 20:48:11 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
21/07/09 20:48:11 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
21/07/09 20:48:11 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:875)
at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:59)
at org.apache.sqoop.manager.CatalogQueryManager.listDatabases(CatalogQueryManager.java:57)
at org.apache.sqoop.tool.ListDatabasesTool.run(ListDatabasesTool.java:49)
at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
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)