I am trying to import some data from mysql to hive via sqoop. It works when both sqoop and mysql db are on the same host, otherwise it fails. This is the query I am executing.
[user@xyz ~]$ sqoop import --connect "jdbc:mysql://abc.something.com/test" --username user --password pass --table dataSql --hive-import --hive-table test.dataHive --target-dir /tmp/sqoop$RANDOM
Please note that I am currently on host xyz
and I am trying to connect to a mysql db on host abc
. Following are the error I see.
ERROR: org.apache.sqoop.manager.SqlManager - Error executing statement: java.sql.SQLException: Access denied for user 'user'@'xyz.something.com' (using password: YES)
.
.
.
ERROR: org.apache.sqoop.manager.CatalogQueryManager - Failed to list columns java.sql.SQLException: Access denied for user 'user'@'xyz.something.com' (using password: YES)
.
.
.
and so on. My question is, why is my machine appending its hostname to username ('user'@'xyz.something.com'
)? How do I solve it?