Updated on 2022-12-08 GMT+08:00

Connecting Sqoop to MySQL

Issue

The user does not know how to connect Sqoop to MySQL.

Procedure

  1. Install the client in the cluster and check whether the MySQL driver package exists in the sqoop/lib directory of the client.

  2. Load environment variables in the client directory.

    source bigdata_env

  3. Perform the Kerberos authentication.

    If Kerberos authentication is not enabled for the cluster, skip this step. If it is enabled, run the following command to authenticate the current user:

    kinit MRS cluster user

    For example:

    kinit admin

  4. Connect to the database.

    sqoop list-databases --connect jdbc:mysql://IP:3306/ --username Username --password Password

    An example is as follows.

    The command output shows that Sqoop is successfully connected to the MySQL database.