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
436 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 by Jimmy

edited May 17
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,280 points
3,935 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
• 68,160 points
106 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
• 25,420 points
77 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
• 25,420 points
168 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
• 68,160 points
41 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
158 views
0 votes
1 answer
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
830 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
119 views