How to pass a password to Sqoop import command?

0 votes
Hi. I am trying to connect sqoop to database using the the sqoop import command and I want to pass the username and the password for the database. How to do this?
May 15 in Big Data Hadoop by John
28 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The safe way to pass a password to the sqoop import command is to store the password in a file and then pass the file. In the user home directory, create a file with .password as the extension and store the password in this file. Change the permissions of this file as follows:

$ chmod 400 pass.password

And then you can pass the username and password as follows:

$ sqoop import --connect jdbc:mysql://<hostname>/employees \ --username <username> --password-file </home/<user>/pass.password>
answered May 15 by Jimmy

edited 5 days ago
0 votes

You can directly pass the password in the command itself without creating a file:

$ sqoop import --connect jdbc:mysql://database.example.com/employees \
    --username <username> --password <password>
answered May 15 by Raj

Related Questions In Big Data Hadoop

0 votes
1 answer

How to count lines in a file on hdfs command?

Use the below commands: Total number of files: hadoop ...READ MORE

answered Aug 10, 2018 in Big Data Hadoop by Neha
• 6,140 points
1,301 views
0 votes
1 answer

How to use sqoop import?

Here is an example of import command. ...READ MORE

answered Dec 14, 2018 in Big Data Hadoop by Omkar
• 65,850 points
56 views
0 votes
0 answers

How to import Flat files in Hadoop using sqoop?

It is possible to import data between ...READ MORE

Apr 9 in Big Data Hadoop by Gitika
• 7,580 points
9 views
0 votes
1 answer

How to import Flat files in Hadoop using sqoop?

Sqoop is a tool which we use ...READ MORE

answered Apr 9 in Big Data Hadoop by Gitika
• 7,580 points
46 views
0 votes
1 answer

Update hdfs data before stroring in MySql

Yes, you can update the data before ...READ MORE

answered Jan 27 in Big Data Hadoop by Omkar
• 65,850 points
18 views
0 votes
1 answer
0 votes
1 answer

Problem connecting Sqoop to MySql

Perhaps, you have slightly misunderstood the method ...READ MORE

answered May 15 in Big Data Hadoop by Ali
17 views
0 votes
1 answer

Using Hadoop for Data Analytics.

Yes, your approach is correct - you ...READ MORE

answered Sep 28, 2018 in Big Data Hadoop by Frankie
• 9,570 points
23 views
0 votes
1 answer

How to import data in sqoop as a Parquet file?

Sqoop allows you to import the file ...READ MORE

answered May 15 in Big Data Hadoop by Nanda
13 views
0 votes
1 answer

How to import selected columns in Sqoop?

If you want to import selected columns, ...READ MORE

answered May 15 in Big Data Hadoop by Shirish
7 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.