Connecting Sqoop to MySQL
Issue
The user does not know how to connect to a MySQL database.
Procedure
- Install the client in the cluster and check whether the MySQL driver package exists in the sqoop/lib directory of the client.
- Load environment variables in the client directory.
source bigdata_env
- Perform Kerberos user authentication.
If Kerberos authentication is enabled for the cluster, run the following command to authenticate the user who has the operation permission. Otherwise, skip this step.
kinit MRS cluster user
- Connect to the database. There can be security risks if a command contains the authentication password. You are advised to disable the command recording function (history) before running the command.
sqoop list-databases --connect jdbc:mysql://Database IP address:3306/ --username Database login username --password Password
The command output shows that Sqoop is successfully connected to the MySQL database.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot