【問題排查】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
- sqoop資料匯入匯出OOP
- sqoop部署及匯入與匯出OOP
- 記一次棧溢位異常問題的排查
- 將資料匯入kudu表(建立臨時hive表,從hive匯入kudu)步驟Hive
- Linux基礎——BClinux8.2 排查vmcore異常當機問題Linux
- 把TXT文字匯入SQLServer常見問題SQLServer
- sqoop匯入orcle注意事項OOP
- Mysqldump匯出亂碼問題排查MySql
- VictoriaMetrics常見效能問題排查
- Spring Boot配置錯誤:Failed to determine a suitable driver classSpring BootAIUI
- laravel-admin 使用laravels時,excel匯出異常的問題LaravelExcel
- TR2021_0000偶發資料庫連線異常問題排查資料庫
- 排查伺服器異常伺服器
- 微服務異常問題微服務
- Linux 上將 txt 匯入 mysqlLinuxMySql
- sqoop進行將Hive 詞頻統計的結果資料傳輸到Mysql中OOPHiveMySql
- Mysql:常見問題MySql
- 10.Java異常問題Java
- Flink Checkpoint超時問題常見排查思路
- 【問題追查】mc叢集寫入恍惚問題排查
- 實戰 | Hive 資料傾斜問題定位排查及解決Hive
- Springboot專案啟動異常排查Spring Boot
- 日常Bug排查-拋異常不回滾
- mysql啟動不了,mysql連線不上,問題排查MySql
- HIVE資料匯入基礎Hive
- 直播 | StarRocks 實戰系列第二期--匯入最佳化&問題排查
- 一次容器MySQL的效能問題排查MySql
- MySQL之 從複製延遲問題排查MySql
- 線上問題排查神器入門——Arthas
- [持續更新]hive異常解決方案Hive