# CREATE CATALOG

{% hint style="info" %}
Catalogs are planned for an upcoming release, and don't yet appear in any current releases.
{% endhint %}

## Syntax

```bnf
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](/docs/server/security/user-account-management/catalogs.md) 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

```sql
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](/docs/server/server-management/install-and-upgrade-mariadb/configuring-mariadb/configuring-mariadb-with-option-files.md) inside the catalog directory.\
The directory will not be recognized as a catalog or show up in [SHOW CATALOGS](/docs/server/security/user-account-management/catalogs/show-catalogs.md) until the `mysql` sub directory is created by [CREATE CATALOG](/docs/server/security/user-account-management/catalogs/create-catalog.md) or [mariadb-install-db](/docs/server/clients-and-utilities/deployment-tools/mariadb-install-db.md).

## See Also

* [marriadb-install-db](/docs/server/clients-and-utilities/deployment-tools/mariadb-install-db.md) can be used to create multiple catalogs with a default root user in one go.
* [DROP CATALOG](/docs/server/security/user-account-management/catalogs/drop-catalog.md)

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/security/user-account-management/catalogs/create-catalog.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
