SELECT Command for retail_user in orders table showing error


#1

This is error msg in after running below sqoop command:

Error msg: SELECT command denied to user ‘retail_user’@‘gw01.itversity.com’ for table ‘orders’

sqoop command:

sqoop import
–connect jdbc:mysql://ms.itversity.com:3306/retail_db
–username retail_user
–password itversity
–query “select o.*, sum(order_item_subtotal) order_revenue
from o.orders join oi.order_items
on o.order_id = oi.order_item_id
and $CONDITIONS group by o.order_id, o.order_date, o.order_customer_id, o.order_status”
–target-dir /user/vivekmishra22117/sqoop_import/retial_db
–as-textfile
–num-mappers 2
–split-by order_id


#2

You need to grant permission to your user in mysql.

mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';

#3

Actually retail_user has already have all privileges…?
and your suggestion is also not working Error is: Access denied


#4

Did you login as root user and then tried grant all privileges?