sqoop - Sqoop List Database - apache sqoop - sqoop tutorial - sqoop hadoop
How to List the Database in Sqoop?
- Sqoop list-databases tool parses and executes the ‘SHOW DATABASES’ query against the database server.
- Thereafter, it lists out the present databases on the server.
![learn sqoop - sqoop tutorial - sqoop2 tutorial - data ingestion tool - sqoop list databases - sqoop code - sqoop programming - sqoop download - sqoop examples](https://wikitechy.com/tutorials/sqoop/img/sqoop-images/sqoop-list-databases.png)
Purpose
List database schemas present on a server.
Common arguments
Argument | Description |
---|---|
--connect <jdbc-uri> | Specify JDBC connect string |
--connect-manager <jdbc-uri> | Specify connection manager class to use |
--driver <class-name> | Manually specify JDBC driver class to use |
--hadoop-home <dir> | Override $HADOOP_HOME |
--help | Print usage instructions |
-P | Read password from console |
--password <password> | Set authentication password |
--username <username> | Set authentication username |
--verbose | Print more information while working |
--connection-param-file <filename> | Optional properties file that provides connection parameters |
Syntax
$ sqoop list-databases (generic-args) (list-databases-args)
$ sqoop-list-databases (generic-args) (list-databases-args)
Click "Copy code" button to copy into clipboard - By wikitechy - sqoop tutorial - team
Sqoop related tags : sqoop import , sqoop interview questions , sqoop export , sqoop commands , sqoop user guide , sqoop documentation
Sample Query
The following command is used to list all the databases in the MySQL database server.
$ sqoop list-databases \
--connect jdbc:mysql://localhost/ \
--username root
Click "Copy code" button to copy into clipboard - By wikitechy - sqoop tutorial - team
Output
If the command executes successfully, then it will display the list of databases in your MySQL database server as follows.
...
13/05/31 16:45:58 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
mysql
test
userdb
db