Sqoop command not working

[premgc05@gw01 data]$ sqoop eval --connect “jdbc:mysql://sandbox.hortonworks.com:3306/retail_db” --username retail_dba --password cloudera --query "select count(1) from order_items"
Warning: /usr/hdp/2.5.0.0-1245/accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
17/04/07 12:57:18 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.5.0.0-1245
17/04/07 12:57:18 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
17/04/07 12:57:18 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
17/04/07 12:57:18 WARN tool.EvalSqlTool: SQL exception executing statement: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

Please share Complete error code.
Rgd’s

I just used the command -

sqoop eval --connect “jdbc:mysql://nn01.itversity.com:3306/retail_db” --username retail_dba --password itversity \

–query "select count(1) from order_items"
and got the result -


count(1)
172198

Hi Pankaj,

Appreciate your response.

I’ve just checked my code was using incorrect credentials.

Cheers.

Regards,
Prem

HI Pankaj,

Can you please help me with the syntax to connect to mysql from command prompt.

I tried couple of them giving error.

[premgc05@gw01 ~]$ mysql -u retail_dba -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘retail_dba’@‘localhost’ (using password: YES)

[premgc05@gw01 ~]$ mysql -h “jdbc:mysql://nn01.itversity.com:3306” -u retail_dba -p
Enter password:
ERROR 2005 (HY000): Unknown MySQL server host ‘jdbc:mysql://nn01.itversity.com:3306’ (0

@premgc05
mysql -u retail_dba -h nn01.itversity.com -p

hit enter after the above command & password is “itversity”

cool. thanks it works for me.