Help Center/ CloudTable Service/ FAQs/ Data Read/Write/ How Do I View the List in the Database Specified by Catalog?
Updated on 2025-08-14 GMT+08:00

How Do I View the List in the Database Specified by Catalog?

Catalog is an external data directory. The following describes how to connect the JDBC Catalog to other data sources through the standard JDBC protocol.

Syntax

CREATE CATALOG [IF NOT EXISTS] catalog_name
    PROPERTIES ("key"="value", ...);
Table 1 Parameter description

Parameter

Mandatory

Default Value

Description

user

Yes

-

Username of the corresponding database.

password

Yes

-

Password of the database.

jdbc_url

Yes

-

JDBC URL.

driver_url

Yes

-

Name of the JDBC Driver JAR package.

driver_class

Yes

-

Name of the JDBC driver class.

lower_case_table_names

No

"false"

Whether to synchronize the database name and table name of the JDBC external data source in lowercase.

only_specified_database

No

"false"

Whether to synchronize only the specified database.

include_database_list

No

""

This parameter is used to synchronize certain databases when only_specified_database is set to true. Use commas (,) to separate databases. The database name is case sensitive.

exclude_database_list

No

""

This parameter is used to not synchronize certain databases when only_specified_database is set to true. Use commas (,) to separate databases. The database name is case sensitive.

  • driver_url can be set to:
    • File name, for example, mysql-connector-java-5.1.47.jar. Place the JAR package in the jdbc_drivers/ directory under the FE and BE deployment directories in advance and the system can locate the file.
    • Local absolute path, for example, file:///path/to/mysql-connector-java-5.1.47.jar. Place the JAR package in the specified paths of all FE and BE nodes in advance.
    • HTTP address, for example, https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/jdbc_driver/mysql-connector-java-5.1.47.jar. The system downloads the driver file from the HTTP address. This only supports HTTP services with no authentication requirements.
  • only_specified_database: You can specify the database or schema to be connected during JDBC connection. For example, you can specify a database in jdbc_url of MySQL and currentSchema in jdbc_url of PostgreSQL.
  • include_database_list: This parameter is used to synchronize certain databases when only_specified_database is set to true. Use commas (,) to separate databases. The database names are case sensitive.
  • exclude_database_list: This parameter is used to not synchronize certain databases when only_specified_database is set to true. Use commas (,) to separate databases. The database names are case sensitive.
  • When include_database_list and exclude_database_list specify overlapping databases, exclude_database_list would take effect with higher privilege over include_database_list.

    If you need to connect to the Oracle database when using these parameters, use the version of the JAR package no less than 8 (such as jdbc8.jar).

Procedure

  1. Create a catalog.

    CREATE CATALOG jdbc_mysql PROPERTIES (
        "type"="jdbc",
        "user"="root",
        "password"="******",
        "jdbc_url" = "JDBC URL",
        "driver_url" = "mysql-connector-java-8.0.25.jar",
        "driver_class" = "com.mysql.cj.jdbc.Driver"
    );

  2. View the Catalog.

    show catalogs;
    Figure 1 Viewing the Catalog

  3. Run the switch Catalog name command to switch to the created catalog.

    Figure 2 Switching to the created catalog

  4. View the mapped database.

    show databases;
    Figure 3 Viewing the mapped database

  5. Use the database.

    use Database name;
    Figure 4 Using the database

  6. Check the database table.

    show tables;
    Figure 5 Checking the database table