Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Sqoop import from mysql : Access denied for user 'root'@'worker01'

Expert Contributor

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?

 

 

 

 

 

 

3 REPLIES 3

Champion

@ludof

 

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

Expert Contributor

Thank you, I've solved creating a new user in MySQL which had also write permissions on HDFS.

New Contributor

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?

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.