Friday 22 April 2022

Sqoop: print all the databases in a RDBMS server

sqoop-list-databases’ command is used to print all the databases.

 

Syntax

sqoop-list-databases --connect "{jdbc_connection_url}" --username "{user_name}" --password "{password}"

Example

$sqoop-list-databases --connect "jdbc:mysql://quickstart.cloudera:3306" --username "root" --password "cloudera"
Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.

22/03/31 03:43:38 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.13.0
22/03/31 03:43:38 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
22/03/31 03:43:38 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
information_schema
cm
firehose
hue
metastore
mysql
nav
navms
oozie
retail_db
rman
sentry
$



Cloudera quick vm providers another non-root user retail_dba, we can also use this to experiment with sqoop.

$sqoop-list-databases --connect "jdbc:mysql://quickstart.cloudera:3306" --username "retail_dba" --password "cloudera"
Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
22/03/31 03:48:40 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.13.0
22/03/31 03:48:40 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
22/03/31 03:48:40 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
information_schema
retail_db




Previous                                                    Next                                                    Home

No comments:

Post a Comment