Created on 01-19-2018 03:28 AM - edited 09-16-2022 05:45 AM
Hello everyone!
I've MySQL server running on the master node (10.0.0.4) with user root which I gave all privileges.
MySQL connection through sqoop works correctly on the master with the following command:
sqoop list-tables \ --driver com.mysql.jdbc.Driver \ --connect jdbc:mysql://10.0.0.4/employees \ --username root --password $pwd
When I launch sqoop job to import a table from MySQL, I got the following error:
java.sql.SQLException: Access denied for user 'root'@'worker01' (using password: YES)
It's like the worker try to access to the mysql db with its hostname, instead of the hostname of the master where I started the job. The sqoop command is the following:
sqoop import \ --driver com.mysql.jdbc.Driver \ --connect jdbc:mysql://10.0.0.4/employees \ --username root --password $pwd \ --table titles \ --split-by emp_no \ --warehouse-dir /user/cloudera/sqoop
Does anyone know how to solve this issue?
Created 01-19-2018 07:34 AM
The table 'titles' will be in hdfs, so the user root cannot access it unless it has permission to read/write (root is not an admin for hdfs). Either you can set the permission to the root user in hdfs for the table or use the user who has already permission to read/write
Created 01-20-2018 01:54 PM
Thank you, I've solved creating a new user in MySQL which had also write permissions on HDFS.
Created 06-14-2018 07:02 AM
I am facing same problem, MySQL server is in remote location, they have created user, but I can not access with same user from hadoop cluster, how to solve this?