[Yandex Cloud documentation](../index.md) > [Yandex WebSQL](index.md) > Getting started

# Getting started with Yandex WebSQL


You can connect to managed database clusters from clouds and folders that belong to your Yandex Cloud [organization](../organization/concepts/organization.md). If you [switch to a different organization](../organization/operations/manage-organizations.md#switch-to-another-org), you will have access to clusters from other clouds and folders. The connections you added will be available while you are in the current cloud.



Once connected to a database, you will be able to view DB schemas, tables, and views, as well as run queries. It is a web-based tool that simplifies writing queries by suggesting prompts and commands.

Yandex WebSQL supports the following DB versions:

* PostgreSQL: 12 or higher.
* MySQL®: 5 or higher.
* ClickHouse®: 23 or higher.
* Valkey™/Valkey™ (non-sharded clusters only): 6 or higher.
* MongoDB/Yandex StoreDoc: 6 or higher.
* [Yandex Managed Service for Trino](../managed-trino/index.md) (currently at the [Preview](../overview/concepts/launch-stages.md) stage): 454 or higher
* Greenplum®: 6 or higher

In this section, you will learn how to connect to:

* [Managed database clusters](#connect-cluster) within Yandex Cloud.
* [Custom DB installations](#connect-db) over the internet.


## Getting started {#before-you-begin}

1. Go to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud or [sign up](https://yandex.com/support/id/authorization/registration.html) if not signed up yet.
1. On the [**Yandex Cloud Billing**](https://center.yandex.cloud/billing/accounts) page, make sure you have a [billing account](../billing/concepts/billing-account.md) linked and its status is `ACTIVE` or `TRIAL_ACTIVE`. If you do not have a billing account, [create one](../billing/quickstart/index.md).
1. Select the organization to work with Yandex WebSQL in or [create a new one](../organization/operations/enable-org.md).


## How to connect to a managed database cluster within Yandex Cloud {#connect-cluster}

Before creating a connection, make sure you have selected the right folder. If you have access to PostgreSQL, ClickHouse®, MySQL®, Greenplum®, Valkey™, or Yandex StoreDoc clusters previously created in that folder, they will automatically appear in the **Yandex Cloud connections** subsection. You will only need to create a connection to the appropriate database in the cluster.


{% note info %}

[Yandex Managed Service for Trino](../managed-trino/index.md) is at the [Preview](../overview/concepts/launch-stages.md) stage. Currently, you cannot create connections to Yandex Managed Service for Trino in the Yandex WebSQL interface. However, if the current folder has a Yandex Managed Service for Trino cluster and the user can access it, the connection will be displayed in WebSQL, available for use. 

{% endnote %}


WebSQL uses connections in Yandex MetaData Hub Connection Manager, so all connections configured in Connection Manager are automatically available in WebSQL provided that the user has the appropriate [roles](../metadata-hub/security/index.md#service-roles).

To create a connection to a Yandex Cloud managed database cluster:

1. Make sure **WebSQL access** is enabled in the cluster settings.
1. Open Yandex WebSQL [**Connections**](https://websql.yandex.cloud).
1. In ![image](../_assets/console-icons/folder-tree.svg) **Connections**, click ![image](../_assets/console-icons/square-plus.svg).
1. In the **Database type** field, select the database you need: PostgreSQL, ClickHouse®, MySQL®, Valkey™, Yandex StoreDoc, or Greenplum®.
1. In the **Cluster folder** field, select the folder hosting the required cluster.
1. In the **Cluster** field, select the managed database cluster you want to connect to. 
1. Specify the **Username** you will use to connect to cluster databases.
1. Enter the user **Password**.
1. List the **Databases** you want to connect to. You can only connect to the databases that exist in this cluster. The user you specified must have access to them.
1. Click **Create**.

If the connection is successful, you will see the cluster structure in the connection tree. Connections to databases within a cluster are grouped into an expandable list under the name of that cluster.

## How to connect to a custom DB installation {#connect-db}

To connect to a custom DB installation over the internet:

1. Open Yandex WebSQL [**Connections**](https://websql.yandex.cloud).
1. In ![image](../_assets/console-icons/folder-tree.svg) **Connections**, click ![image](../_assets/console-icons/square-plus.svg).
1. In the bottom-left corner of the window that opens, click **External connection**.
1. **Name** the connection.
1. In the **Database type** field, select the database: PostgreSQL, ClickHouse®, MySQL®, Valkey™, MongoDB, Greenplum®, Valkey™, or Yandex StoreDoc.
1. Under **Hosts**, configure the hosts:
    * Specify the database host FQDN and port number for connecting to the database.
    * For ClickHouse®, also specify the Native Protocol port and [shard](../managed-clickhouse/operations/shards.md#list-shards) name.
    * Optionally, enable TLS.

        If your company has a certification authority (CA), the certificate issued by the CA will be used by default. If the company has no CA, upload the server's TLS certificate.

1. Specify the **Username** you will use to connect to the database.
1. Enter the user **Password**.
1. List the **Databases** you want to connect to. You can only connect to existing databases. The user you specified must have access to them.
1. Click **Create**.

If the connection is successful, you will see the database structure in the connection tree.

## What's next {#what-is-next}

* [Manage connections](operations/connect.md)
* [Run queries](operations/query-executor.md)
* [Create query templates](operations/templates.md)
* [View query history](operations/history.md)

_ClickHouse® is a registered trademark of [ClickHouse, Inc](https://clickhouse.com)._