sqoop import issue with mysql

前端 未结 9 1662
情深已故
情深已故 2021-01-13 04:07

I have a hadoop ha setup based on cdh5.I have tried to import tables from mysql by using sqoop failed with following error.

15/03/20 12:47:53 ERROR manager.         


        
相关标签:
9条回答
  • 2021-01-13 04:13

    Try using the below modified command, which can suit your purpose

    sqoop import --connect jdbc:mysql://<mysql hostname>:3306/haddata --driver com.mysql.jdbc.Driver --username root --password password --table authors --hive-import
    
    0 讨论(0)
  • 2021-01-13 04:17

    follow this link

    Include the driver argument --driver com.mysql.jdbc.Driver in sqoop command.

    sqoop import --connect jdbc:mysql://<mysql hostname>:3306/<db name> --username **** --password **** --table <table name> --hive-import --driver com.mysql.jdbc.Driver

    The --driver parameter forces sqoop to use the latest mysql-connector-java.jar installed for mysql db on the sqoop machine

    0 讨论(0)
  • 2021-01-13 04:17

    Try the exact command as like below.

    sqoop import --connect "jdbc:mysql://localhost:3306/books" --username=root --password=root --table authors --as-textfile --target-dir=/datasqoop/authors_db --columns "id, name, email" --split-by id --driver com.mysql.jdbc.Driver

    This will resolve your issues.

    0 讨论(0)
  • 2021-01-13 04:23

    Try including the option --driver com.mysql.jdbc.Driver in the import command.

    0 讨论(0)
  • 2021-01-13 04:30

    Sqoop does not ship with third party JDBC drivers. You must download them separately and save them to the /var/lib/sqoop/ directory on the server.

    Note: The JDBC drivers need to be installed only on the machine where Sqoop runs. You do not need to install them on all hosts in your Hadoop cluster.

    You can download driver from here : https://dev.mysql.com/downloads/connector/j/5.1.html

    0 讨论(0)
  • 2021-01-13 04:32

    including the option --driver com.mysql.jdbc.Driver in the import command worked for me.

    0 讨论(0)
提交回复
热议问题