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, 2019 in Big Data Hadoop by John
7,166 views

2 answers to this question.

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, 2019 by Jimmy

edited May 17, 2019
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, 2019 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,300 points
28,767 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
• 69,220 points
841 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, 2019 in Big Data Hadoop by Gitika
• 65,770 points
853 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, 2019 in Big Data Hadoop by Gitika
• 65,770 points
2,006 views
0 votes
1 answer

Update hdfs data before stroring in MySql

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

answered Jan 27, 2019 in Big Data Hadoop by Omkar
• 69,220 points
771 views
0 votes
1 answer

How to connect Sqoop to mysql Database?

Hi. You can connect Sqoop to MySql ...READ MORE

answered May 15, 2019 in Big Data Hadoop by Tina
2,693 views
0 votes
1 answer

Problem connecting Sqoop to MySql

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

answered May 15, 2019 in Big Data Hadoop by Ali
2,277 views
0 votes
1 answer

Connection String for MySQL database using Sqoop

The format for the connection string and ...READ MORE

answered Jun 6, 2019 in Big Data Hadoop by John
2,023 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, 2019 in Big Data Hadoop by Nanda
11,005 views
0 votes
1 answer

How to import selected columns in Sqoop?

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

answered May 15, 2019 in Big Data Hadoop by Shirish
1,801 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP