This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-14. For the latest, interactive version please visit https://mariadb.com/kb/.

CREATE CATALOG

MariaDB starting with 11.8

Catalog support is planned for 11.8.

Syntax

CREATE CATALOG [IF NOT EXISTS] catalog_name
    [create_specification] ...

create_specification:
    [DEFAULT] CHARACTER SET [=] charset_name
  | [DEFAULT] COLLATE [=] collation_name
  | COMMENT [=] 'comment'

Description

Creates a catalog and the mysql, sys and performance_schema schemas inside the catalog.

CREATE CATALOG can only be performed by a user in the def catalog with the CATALOG privilege.

Note that no users are created.

Example

create catalog cat1;
use catalog cat1;
create user root@localhost;
grant all privileges on *.* to root@localhost;
create database test;

Limitations

The catalog name is limited to 64 characters. All characters must be in the basic ASCII set: (A-Z, a-z, -, _) This limitations is to be able to run catalogs with engines like InnoDB which has limited space in their internal data dictionary.

Pre-Creating Catalog Directories

CREATE CATALOG works even if the catalog directory already exists (as long as there is no mysql sub directory). This is to allow a database administrator to pre-create the catalog directory and mount it to disk volume and optionally add a configuration file inside the catalog directory. The directory will not be recognized as a catalog or show up in SHOW CATALOGS until the mysql sub directory is created by CREATE CATALOG or mariadb-install-db.

See Also

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.