Sqoop list database and tables

Let’s study about Sqoop list database and tables,

In this article will study about, how to list databases of mysql. And also tables of particular database in mysql using Sqoop.

1. Sqoop list database

In this case Sqoop list the entire database present in the server using “list-databases” tool.

Example

The below command is used to list all the databases in the MySQL database server.

$ sqoop list-databases

–connect jdbc:mysql://localhost/

–username “root”

–password “beyonduser”

 2. Sqoop list tables

In this case Sqoop list the entire tables with respect to particular database using “list-tables” tool.

Example

The below command is used to list all the tables of “beyondcorner” database in the MySQL database server.

 $ sqoop list-tables

–connect jdbc:mysql://localhost/beyondcorner

–username “root”

–password “beyonduser”    

References

https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_literal_sqoop_list_databases_literal

https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_literal_sqoop_list_tables_literal