Database management in Managed Service for ClickHouse
Managed Service for ClickHouse lets you manage cluster databases two ways:
- Using Nebius AI standard interfaces (CLI or management console). Select this method if you wish to create and delete cluster databases using Managed Service for ClickHouse features.
- SQL queries to the cluster. Select this method if you want to use an existing solution for creating and managing databases, or if you need MySQL database support in Managed Service for ClickHouse.
Managing databases via SQL
To enable management, activate the User management via SQL and Managing databases via SQL options when creating or reconfiguring a cluster.
In a cluster with DB management via SQL enabled:
- Database and user management using the standard Nebius AI interfaces (CLI, management console) is unavailable.
- You cannot enable user or database management using the standard Nebius AI interfaces.
- The existing users as well as user and database settings made with the standard Nebius AI interfaces will be saved.
- Users are managed under the
admin
account. You set its password when selecting the User management via SQL and Managing databases via SQL options.
Getting a list of cluster databases
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the name of the cluster and select the Databases tab.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To get a list of databases in a cluster, run the command:
ncp managed-clickhouse database list \
--cluster-name <cluster name>
The cluster name can be requested with a list of clusters in the folder.
-
Connect to a cluster using the
admin
account. -
Get a list of databases:
SHOW DATABASES;
Creating a database
Note
You can create a maximum of 1000 databases in each cluster.
-
In the management console
, go to the folder page and select Managed Service for ClickHouse. -
Click the cluster name.
-
Select the Databases tab.
-
Click Add.
-
Enter the database name and click Add.
The database name may contain Latin letters, numbers, and underscores. The maximum name length is 63 characters. You can't create a database named
default
.
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
Run the create database command and set the name of the new database:
ncp managed-clickhouse database create <database name> \
--cluster-name <cluster name>
The database name may contain Latin letters, numbers, and underscores. The maximum name length is 63 characters. You can't create a database named default
.
The cluster name can be requested with a list of clusters in the folder.
Managed Service for ClickHouse runs the create database operation.
-
Connect to a cluster using the
admin
account. -
Create a database:
CREATE DATABASE <database name>;
The database name may contain Latin letters, numbers, and underscores. The maximum name length is 63 characters. You can't create a database named
default
.
To learn more about creating databases, see the ClickHouse documentation
Deleting a database
- In the management console
, go to the folder page and select Managed Service for ClickHouse. - Click the cluster name and open the Databases tab.
- Click
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To delete a database, run the command:
ncp managed-clickhouse database delete <database name> \
--cluster-name <cluster name>
The cluster name can be requested with a list of clusters in the folder.
-
Connect to a cluster using the
admin
account. -
Delete the database:
DROP DATABASE <database name>;
For more information about deleting objects, see the ClickHouse documentation
Warning
Before creating a new database with the same name, wait for the delete operation to complete, otherwise the database being deleted will be restored. Operation status can be obtained with a list of cluster operations.