01-19-2018 03:28 AM
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?
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