Sqoop list-tables command could not access database retail_db

when I ran below query to list tables , it does not work citing some permission issue, how do I resolve this ?

query:
sqoop list-tables --connect “jdbc:mysql://xxxxxxx.internal//retail_db” --username sqoopuser -P

detailed error is :

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.6.2.0-205/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.6.2.0-205/accumulo/lib/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
19/10/03 22:11:30 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.6.2.0-205
19/10/03 22:11:30 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
19/10/03 22:11:30 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
19/10/03 22:11:30 ERROR manager.CatalogQueryManager: Failed to list tables
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ‘sqoopuser’@’%’ to database ‘/retail_db’

but I am able to query the same database retail_db from mysql prompt

Hi,
The permission issue is because of the host ip address, and you can re-check the MySQL ip hosting address.
The below command will help.
import --connect jdbc:mysql:ip-172-31-13-154:3306/sqoopex --username sqoopuser --password NHkkP876rp --table widgets --target-dir hdfs:///user/LocalUsername/widgets_import

1 Like