Reply
Expert Contributor
Posts: 65
Registered: ‎11-24-2017

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

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?

 

 

 

 

 

 

Posts: 474
Topics: 14
Kudos: 77
Solutions: 41
Registered: ‎09-02-2016

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

@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
Posts: 65
Registered: ‎11-24-2017

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

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

New Contributor
Posts: 1
Registered: ‎06-14-2018

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

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?

Announcements