This topic describes what a default catalog is and how to use a default catalog to query internal data in a StarRocks cluster.

Default Catalog

StarRocks 2.3 and later allow you to use an internal catalog to manage internal data in a StarRocks cluster. Each StarRocks cluster has only one internal catalog named default_catalog. You cannot modify the name of the internal catalog of a StarRocks cluster or create another internal catalog for the StarRocks cluster.

Query internal data

Note Replace <db_name> and <table_name> in this topic with the actual values.
  1. Connect to the StarRocks cluster. For more information, see Getting started.
    • If you use the MySQL client to connect to the StarRocks cluster, the default_catalog catalog is accessed by default after the connection is complete.
    • If you use a Java Database Connectivity (JDBC) connection string to connect to the StarRocks cluster, you can specify the database to be accessed in the default_catalog.db_name format.
  2. Optional:View all databases in the StarRocks cluster.
    SHOW DATABASES;
    -- Specify the name of the catalog.
    SHOW DATABASES FROM default_catalog;
  3. Optional:Switch to the specified database.
    USE <db_name>;
    -- Specify the name of the catalog.
    USE default_catalog.<db_name>;
  4. Query internal data.
    SELECT * FROM <table_name>;
    If you do not specify a database in the preceding steps, you can specify it in the query statement.
    • If you do not specify the name of the catalog, execute the following statement to query internal data:
      SELECT * FROM <db_name>.<table_name>;
    • If you specify the name of the catalog, execute the following statement to query internal data:
      SELECT * FROM default_catalog.<db_name>.<table_name>;