Sqoop教程

Sqoop 列出表格

本章介绍如何使用 Sqoop 列出 MySQL 数据库服务器中特定数据库的表。 Sqoop 列表表工具解析并执行针对特定数据库的"SHOW TABLES"查询。此后,它会列出数据库中的当前表。

语法

以下语法用于 Sqoop list-tables 命令。
$ sqoop list-tables (generic-args) (list-tables-args) 
$ sqoop-list-tables (generic-args) (list-tables-args)

示例查询

以下命令用于列出MySQL数据库服务器 userdb数据库中的所有表。
$ sqoop list-tables \
--connect jdbc:mysql://localhost/userdb \
--username root
如果命令执行成功,则会显示 userdb数据库中的表列表如下。
...
13/05/31 16:45:58 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
emp
emp_add
emp_contact
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4