【問題排查】sqoop將mysql匯入hive異常:No suitable driver
問題描述
安裝Sqoop後,
將mysql匯入hive異常: No suitable driver found for jdbc:mysql:/192.168.5.102:3306/test
具體報錯如下
[root@hx002 ~]#
sqoop export --connect jdbc
:mysql:/192.168.5.102:3306/test
--username root --password root1234 --table ods_test_stu --export-dir /user/hive/warehouse/ods_test_stu --fields-terminated-by '\001'
Warning: /opt/module/sqoop-1.4.7.bin__hadoop-2.6.0/../hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /opt/module/sqoop-1.4.7.bin__hadoop-2.6.0/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /opt/module/sqoop-1.4.7.bin__hadoop-2.6.0/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
Warning: /opt/module/sqoop-1.4.7.bin__hadoop-2.6.0/../zookeeper does not exist! Accumulo imports will fail.
Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.
22/05/05 10:54:34 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7
22/05/05 10:54:34 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
22/05/05 10:54:34 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
22/05/05 10:54:35 INFO tool.CodeGenTool: Beginning code generation
22/05/05 10:54:35 ERROR manager.SqlManager
: Error executing statement: java.sql.SQLException: No suitable driver found for jdbc:mysql:/192.168.5.102:3306/test
java.sql.SQLException: No suitable driver found for jdbc:mysql:/192.168.5.102:3306/test
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:904)
at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:59)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:763)
at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:786)
at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:289)
at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:260)
at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:246)
at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:327)
at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1872)
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1671)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:106)
at org.apache.sqoop.tool.ExportTool.exportTable(ExportTool.java:63)
at org.apache.sqoop.tool.ExportTool.run(ExportTool.java:99)
at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
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)
22/05/05 10:54:35 ERROR tool.ExportTool: Encountered IOException running export job:
java.io.IOException
: No columns to generate for ClassWriter
at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1677)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:106)
at org.apache.sqoop.tool.ExportTool.exportTable(ExportTool.java:63)
at org.apache.sqoop.tool.ExportTool.run(ExportTool.java:99)
at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
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)
問題排查與解析
錯誤排查,連線URL格式出現問題:
錯誤輸入:
[root@hx002 ~]#
sqoop export --connect jdbc
:mysql:/192.168.5.102:3306/test
--username root --password root1234 --table ods_test_stu --export-dir /user/hive/warehouse/ods_test_stu --fields-terminated-by '\001'
修改後
sqoop export --connect jdbc:
mysql://192.168.5.102:3306/test --username root --password root1234 --table ods_test_stu --export-dir /user/hive/warehouse/ods_test_stu --fields-terminated-by '\001'
問題延展
今天編碼出現了No suitable driver found for jdbc,找遍了網上的資料,基本上都說是三個問題:
一是:連線URL格式出現了問題(Connection conn=DriverManager.getConnection("jdbc:
")
二是:驅動字串出錯(com.mysql.jdbc.Driver)
三是Classpath中沒有加入合適的mysql_jdbc驅動
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70017085/viewspace-2892484/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Sqoop將MySQL資料匯入到hive中OOPMySqlHive
- sqoop用法之mysql與hive資料匯入匯出OOPMySqlHive
- Sqoop匯入資料異常處理OOP
- JuiceFS CSI Driver 常見問題排查指南UI
- 異常問題排查之旅
- sqoop1.4.7環境搭建及mysql資料匯入匯出到hiveOOPMySqlHive
- Sqoop匯出ClickHouse資料到HiveOOPHive
- Centos 系統簡單排查流量異常問題CentOS
- 從hive將資料匯出到mysql(轉)HiveMySql
- 記一次棧溢位異常問題的排查
- 將資料匯入kudu表(建立臨時hive表,從hive匯入kudu)步驟Hive
- sqoop資料匯入匯出OOP
- mysql 資料sqoop到hive 步驟MySqlOOPHive
- 雲伺服器ECS伺服器訪問異常問題排查指引伺服器
- MySQL資料匯入匯出亂碼問題MySql
- mysql 5.5.9 匯出匯入到5.1.41 的問題MySql
- Mysqldump匯出亂碼問題排查MySql
- sqoop部署及匯入與匯出OOP
- sqoop定時增量匯入匯出OOP
- 把TXT文字匯入SQLServer常見問題SQLServer
- Mysql show processlist 排查問題MySql
- 解決Mysql匯入亂碼問題MySql
- sqoop匯出hive資料到mysql錯誤ava.util.NoSuchElementException解決辦法OOPHiveMySqlException
- 排查伺服器異常伺服器
- VictoriaMetrics常見效能問題排查
- Linux基礎——BClinux8.2 排查vmcore異常當機問題Linux
- sqoop匯入orcle注意事項OOP
- 微服務異常問題微服務
- laravel-admin 使用laravels時,excel匯出異常的問題LaravelExcel
- Spring Boot配置錯誤:Failed to determine a suitable driver classSpring BootAIUI
- java通過jdbc連線oracle報錯No suitable driverJavaJDBCOracleUI
- TR2021_0000偶發資料庫連線異常問題排查資料庫
- 10.Java異常問題Java
- 定時將資料匯入到hive的shell指令碼Hive指令碼
- Linux 上將 txt 匯入 mysqlLinuxMySql
- mysql常見問題MySql
- MySQL 常見問題MySql
- Mysql:常見問題MySql