Support Questions

Find answers, ask questions, and share your expertise

SQOOP - MYSQL - Practice test instance

I am working on HDPCD practice test instance. Can anybody let me know -

a) Is there anything I should do before issue sqoop command on AWS practice instance.

b) what is the parameter I should use for --connect jdbc:?????

1 ACCEPTED SOLUTION

Guru

Everything is configured perfectly fine on the real exam for Sqoop to work. It's also configured correctly on the practice exam. If you are having trouble getting the command to work, the solution is in the /home/horton/solutions folder on the Ubuntu instance. Try running the solution. If that fails, please share the error and I can help you from there.

View solution in original post

17 REPLIES 17

Super Guru

@Vidya SK

Run below command to list the tables:

sqoop list-tables --connect jdbc:mysql://<mysql-server>/database --username <username> --password <password>

what is the value for <MySQL-server> on practice instance?

Guru

The server name is namenode

@Kuldeep Kulkarni

what is the value for <MySQL-server> on practice instance?

Super Guru

@Vidya SK - Goto Ambari UI -> select Hive service -> you should see mysql server there -> just point your mouse arrow over the link and you should get the name of mysql server

OR

you will get it in hive-site.xml

grep -A 2 mysql /etc/hive/conf/hive-site.xml

@Kuldeep Kulkarni

Thanks Kuldeep.

With the above grep command, I got the following:

1227-mysql.jpg

Sqoop Command:

1228-sqoop-cmd.jpg

I am getting following error. Please suggest.

1229-error.jpg

Super Guru

@Vidya SK - you are getting access denied exception that means user root does not have access to mysql DB using password 'hadoop'. please check your password and try again with valid username and password

Mentor

Just reset the root password I had to reset the MySQL password to do so follow the below process.Start the DB if its down

[root@sandbox]# service mysqld start

Starting mysqld: [ OK ]

Reset the MySQL password

[root@sandbox]# mysqladmin -u root -h sandbox.hortonworks.com password 'newpassword'

[root@sandbox]# mysqladmin -u root password 'newpassword'

Try out the new password and it seems to work out well

[root@sandbox]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 6

Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select user();

After validating the successful logon retry

Mentor

@rich @Vidya SK are you still having issues with this? Can you accept best answer or provide your own solution?

@Artem Ervits

During the HDPCD exam, do we have to do this initial set up like - set up user, grant access etc. before we use sqoop commands? Or are these already taken care and we just run sqoop commands? If some access is not working can we ask the proctor to stop the clock and set up the required environment?

Mentor

@rich can help with HDPCD related questions

@rich

During the HDPCD exam, do we have to do this initial set up like - set up user, grant access etc. before we use sqoop commands? Or are these already taken care and we just run sqoop commands? If some access is not working can we ask the proctor to stop the clock and set up the required environment?

Guru

Everything is configured perfectly fine on the real exam for Sqoop to work. It's also configured correctly on the practice exam. If you are having trouble getting the command to work, the solution is in the /home/horton/solutions folder on the Ubuntu instance. Try running the solution. If that fails, please share the error and I can help you from there.

@rich I have accepted this as best answer.

@rich

I ran the sqoop command. I get the following error msg. Please look at the screen shot. Thanks.

sqoop.png

Guru

You spelled "input-fields-terminated-by" incorrectly. I would bet that it will work once you fix that.

@rich

Thanks rich. your solution worked out. I accept this answer.