Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex DataLens
  • DataLens neuroanalyst
    • Overview
    • Versioning
    • Caching
    • Combining data
    • Adding connection info
      • Creating a ClickHouse® connection
      • Creating a PostgreSQL connection
      • Creating a MySQL® connection
      • Creating a YDB connection
      • Creating a Greenplum® connection
      • Creating a SQL Server connection
      • Creating an Oracle Database connection
      • Creating a StarRocks connection
      • Creating a Prometheus connection
      • Creating a Snowflake connection
      • Creating a Trino connection
  • Gallery in DataLens
  • Audit Trails events
  1. Connections
  2. Databases
  3. Creating a MySQL® connection

Creating a connection to MySQL® in Yandex DataLens

Written by
Yandex Cloud
Updated at June 2, 2026

Warning

Yandex Cloud holds no responsibility for configuring a remote connection on an external database server side. When connecting an external database that is not a Yandex Cloud resource:

  • Make sure the database uses an SSL certificate signed by a SSL certificate authority. You will not be able to create a connection in DataLens if the database uses a self-signed SSL certificate.

  • Grant database access to the following DataLens IP ranges (/ is followed by the subnet mask length):

    ipv4
    ipv6
    • 178.154.242.176/28
    • 178.154.242.192/28
    • 178.154.242.208/28
    • 178.154.242.128/28
    • 178.154.242.144/28
    • 178.154.242.160/28
    • 130.193.60.0/28
    • 2a02:6b8:c03:500:0:f83d:a987:0/112
    • 2a02:6b8:c02:900:0:f83d:a987:0/112
    • 2a02:6b8:c0e:500:0:f83d:a987:0/112
    • 2a02:6b8:c41:1300:0:f83d:a987:0/112

To create a MySQL® connection:

  1. Open the connection creation page.

  2. Under Databases, select the MySQL connection.

  3. Select the connection type:

    Select in organization
    Specify manually
    Connection Manager

    Select a managed database in the current Yandex Cloud organization and specify the internal network connection parameters for it:

    • Cloud and folder: Select the folder the cluster is located in.

    • Cluster: Specify the cluster from the list of available MySQL® clusters. Cluster settings must have the DataLens access option enabled. If you do not have an available cluster, click Create new.

      Note

      The list shows the following clusters:

      • With permissions for the user creating the connection.
      • Created in the same organization as the DataLens instance.
    • Host type: Select the host type:

      • Regular (default): Allows you to select regular hosts to connect to.
      • Special FQDNs: Enables you to select special FQDNs for connection, which always point to the current master host or to its closest replica in the MySQL® cluster.
    • Host name: Select the host name from the list of hosts available in the MySQL® cluster. You can select multiple hosts. If you fail to connect to the first host, DataLens will select the next one from the list.

    • Port: Specify the MySQL® connection port. The default port is 3306.

    • Path to database: Specify the name of the database to connect to.

    • Username: Specify the username for the MySQL® connection.

    • Password: Enter the password for the user.

    • Cache TTL in seconds: Specify the cache TTL or leave the default value. The recommended value is 300 seconds (5 minutes).

    • Raw SQL level: Enables you to use an ad-hoc SQL query to generate a dataset. This option is disabled by default. When enabling it, you will need to select the raw SQL level:

      • Allow subqueries in datasets: Describe dataset sources using SQL queries.
      • Allow subqueries in datasets and source parameterization: Describe dataset sources using SQL queries and use source parameterization.
      • Allow subqueries in datasets, source parameterization, and QL charts: Describe dataset sources using SQL queries, use source parameterization, and create QL charts.

    Click Check connection to make sure the parameters are correct.

    Manually specify your external database details to connect to via a public network:

    • Host name: Specify the path to a master host or a MySQL® master host IP address. You can specify multiple hosts in a comma-separated list. If you fail to connect to the first host, DataLens will select the next one from the list.
    • Port: Specify the MySQL® connection port. The default port is 3306.
    • Path to database: Specify the name of the database to connect to.
    • Username: Specify the username for the MySQL® connection.
    • Password: Enter the password for the user.
    • Cache TTL in seconds: Specify the cache TTL or leave the default value. The recommended value is 300 seconds (5 minutes).
    • Raw SQL level: Enables you to use an ad-hoc SQL query to generate a dataset. This option is disabled by default. When enabling it, you will need to select the raw SQL level:

      • Allow subqueries in datasets: Describe dataset sources using SQL queries.
      • Allow subqueries in datasets and source parameterization: Describe dataset sources using SQL queries and use source parameterization.
      • Allow subqueries in datasets, source parameterization, and QL charts: Describe dataset sources using SQL queries, use source parameterization, and create QL charts.

    image

    Click Check connection to make sure the parameters are correct.

    Note

    To use a Connection Manager connection in DataLens, the user must have the connection-manager.user role for this connection.

    Select the connection to a MySQL® managed database cluster created in Yandex Connection Manager:

    • Cloud and folder: Select the folder where you created the connection to the cluster.
    • Connection ID: Select an available connection in Connection Manager or create a new one.
    • Host: Select the host from the list of available hosts in the MySQL® cluster.
    • Port: It is set automatically depending on the selected host.
    • Database: Specify the name of the database to connect.
    • Username: It is set automatically from the selected connection data.
    • Cache TTL in seconds: Specify the cache TTL or leave the default value. The recommended value is 300 seconds (5 minutes).
    • Raw SQL level: Enables you to use an ad-hoc SQL query to generate a dataset. This option is disabled by default. When enabling it, you will need to select the raw SQL level:

      • Allow subqueries in datasets: Describe dataset sources using SQL queries.
      • Allow subqueries in datasets and source parameterization: Describe dataset sources using SQL queries and use source parameterization.
      • Allow subqueries in datasets, source parameterization, and QL charts: Describe dataset sources using SQL queries, use source parameterization, and create QL charts.
  4. Click Create connection.

  5. Select the workbook to save your connection to or create a new one. If using legacy folder navigation, select a folder to save the connection to. Click Create.

  6. Enter a name for the connection and click Create.

Additional settingsAdditional settings

You can specify additional connection settings under Advanced connection settings:

  • Setting collate in a query: To explicitly define a collation for database queries, select a mode:

    • Auto: Applies the default setting. DataLens decides whether to enable the utf8mb4_general_ci locale.
    • On: Applies the DataLens setting. The utf8mb4_general_ci locale is specified for individual expressions within a query. Thus the server uses the appropriate sorting logic, regardless of the server settings and specific tables. Use the DataLens setting if your database locale is incompatible with DataLens. For more information on the locale and COLLATE, see Changing a character set and collation rules.
    • Off: Applies the default setting. DataLens only uses database-level locale settings.
  • TLS: Indicates whether TLS is required. When this option is enabled, the connection requires using SSL.

  • CA Certificate: To upload a certificate, click Attach file and select the certificate file. When the certificate is uploaded, the field shows the file name.

  • Disable data export: When this option is on, the data export item will not be available in the menu for the charts based on this connection. However, you will still be able to copy chart data and take screenshots.

Was the article helpful?

Previous
Creating a PostgreSQL connection
Next
Creating a YDB connection
© 2026 Direct Cursus Technology L.L.C.