Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Query
    • Data formats and compression algorithms
    • Working with Managed Service for ClickHouse® databases
    • Working with Managed Service for Greenplum® databases
    • Working with Managed Service for MySQL® databases
    • Working with Managed Service for PostgreSQL databases
    • Working with Managed Service for YDB databases
    • Writing metrics to Yandex Monitoring
  • Access management
  • Pricing policy
  • Integration
  • Audit Trails events
  • FAQ

In this article:

  • Setting up a connection
  • Query syntax
  • Limitations
  • Filter pushdown
  • Supported data types
  1. Data sources and targets
  2. Working with Managed Service for MySQL® databases

Working with Managed Service for MySQL® databases

Written by
Yandex Cloud
Updated at March 6, 2025
  • Setting up a connection
  • Query syntax
  • Limitations
  • Filter pushdown
  • Supported data types

This section provides the basic information about working with Managed Service for MySQL®.

To work with a Managed Service for MySQL® database, follow these steps:

  1. Create a connection containing your database connection credentials.
  2. Run a query to the database.

Example of a query for reading data from Managed Service for MySQL®:

SELECT * FROM mysql_mdb_connection.my_table

Where:

  • mysql_mdb_connection: Name of the DB connection you created.
  • my_table: Name of the table in the database.

Setting up a connection

To create a connection to Managed Service for MySQL®:

  1. In the management console, select the folder where you want to create a connection.

  2. In the list of services, select Yandex Query.

  3. In the left-hand panel, go to the Connections tab.

  4. Click Create new.

  5. Specify the connection parameters:

    1. Under General parameters:

      • Name: Name of the connection to Managed Service for MySQL®.
      • Type: Managed Service for MySQL.
    2. Under Connection type parameters:

      • Cluster: Select an existing Managed Service for MySQL® cluster or create a new one.

      • Service account: Select an existing Managed Service for MySQL® service account, or create a new one with the managed-mysql.viewer role, and use it to connect to Managed Service for MySQL® clusters.

        To use a service account, the iam.serviceAccounts.user role is required.

      • Database: Select the database you will use when working with the MySQL® cluster.

      • Login: Username to use when connecting to MySQL® databases.

      • Password: User password to use when connecting to MySQL® databases.

  6. Click Create.

You need a service account to detect Managed Service for MySQL® cluster connection points inside Yandex Cloud. You need a separate login/password pair to access data.

Warning

First, allow network access from Yandex Query to Managed Service for MySQL® clusters. To do this, enable Access from Yandex Query in the settings of the database to which you are connecting.

Query syntax

Here is the SQL query format used to access MySQL®:

SELECT * FROM <connection>.<table_name>

Where:

  • <connection>: Name of the DB connection you created.
  • <table_name>: Name of the table in the database.

Limitations

There are several limitations when working with MySQL® clusters.

  • External sources are only available for data reading through SELECT requests. Yandex Query does not currently support requests that modify tables in external sources.

  • YQ uses the Yandex Managed Service for YDB type system. However, the ranges of acceptable values for types used in YDB for date and time operations (Date, Datetime, and Timestamp) often turn out to be insufficiently wide to cover the values of the relevant MySQL® types (date, datetime, and timestamp). Therefore, YQ returns date and time values read from MySQL® as plain strings (Optional<Utf8> type) in ISO-8601 format.

Filter pushdown

Yandex Query can transfer processing of request parts to the data source system. This means that filter expressions are provided through Yandex Query directly to the database for processing; these are typically the query conditions specified in WHERE. This kind of processing is called filter pushdown.

Filter pushdown is possible when using:

Description Example
Filters like IS NULL/IS NOT NULL WHERE column1 IS NULL or WHERE column1 IS NOT NULL
Logical conditions OR, NOT, or AND WHERE column IS NULL OR column2 is NOT NULL
Conditions =, <>, <, <=, >, >= for comparison with other columns or constants WHERE column3 > column4 OR column5 <= 10

Supported data types for filter pushdown:

Data type Yandex Query
Bool
Int8
Uint8
Int16
Uint16
Int32
Uint32
Int64
Uint64
Float
Double

Supported data types

In a MySQL DB, the optionality of column values (whether or not the column can contain NULL values) does not depend on the type system. The NOT NULL constraint for any column of any table is stored as a value of the IS_NULLABLE column in the INFORMATION_SCHEMA.COLUMNS system table, i.e., at the table metadata level. Thus, by default, all MySQL® base types can contain NULL values and the YQ type system will represent them as optional types.

The table below shows how MySQL® and Yandex Query types map. All other data types except those listed are not supported.

Data type MySQL® Data type Yandex Query
bool Optional<Bool>
tinyint Optional<Int8>
tinyint unsigned Optional<Uint8>
smallint Optional<Int16>
smallint unsigned Optional<Uint16>
mediumint Optional<Int32>
mediumint unsigned Optional<Uint32>
int Optional<Int32>
int unsigned Optional<Uint32>
bigint Optional<Int64>
bigint unsigned Optional<Uint64>
float Optional<Float>
real Optional<Float>
double Optional<Double>
date Optional<Utf8>
datetime Optional<Utf8>
timestamp Optional<Utf8>
tinyblob Optional<String>
blob Optional<String>
mediumblob Optional<String>
longblob Optional<String>
tinytext Optional<String>
text Optional<String>
mediumtext Optional<String>
longtext Optional<String>
char Optional<Utf8>
varchar Optional<Utf8>
binary Optional<String>
varbinary Optional<String>
json Optional<Json>

Was the article helpful?

Previous
Working with Managed Service for Greenplum® databases
Next
Working with Managed Service for PostgreSQL databases
Yandex project
© 2025 Yandex.Cloud LLC