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 Query
    • Data formats and compression algorithms
    • Working with Managed Service for ClickHouse® databases
    • Working with Yandex MPP Analytics for PostgreSQL databases
    • Working with Managed Service for MySQL® databases
    • Working with Managed Service for PostgreSQL databases
    • Working with Managed Service for YDB databases
    • Reading Iceberg tables
  • Access management
  • Pricing policy
  • Integrations
  • Audit Trails events
  • FAQ

In this article:

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

Working with Managed Service for MySQL® databases

Written by
Yandex Cloud
Updated at July 1, 2026
View in Markdown
  • Setting up a connection
  • Query syntax
  • Limitations
  • Filter pushdown
  • Supported data types

This section covers the basics of working with Managed Service for MySQL®.

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

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

Query example for reading data from Managed Service for MySQL®:

SELECT * FROM mysql_mdb_connection.my_table

Where:

  • mysql_mdb_connection: Your database connection name.
  • my_table: Database table name.

Setting up a connectionSetting 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. Navigate to Yandex Query.

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

  4. Click Create new.

  5. Specify the connection settings:

    1. Under General parameters:

      • Name: Managed Service for MySQL® connection name.
      • 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. Assign it the managed-mysql.viewer role allowing 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 you will use to connect to MySQL® databases.

      • Password: Password you will use to connect to MySQL® databases.

  6. Click Create.

A service account is necessary to detect Managed Service for MySQL® cluster connection endpoints inside Yandex Cloud. To access data, you need a separate username and password.

Warning

First, grant network access from Yandex Query to Managed Service for MySQL® clusters. To do this, enable Access from Yandex Query in your target database settings.

Query syntaxQuery syntax

MySQL® uses the following SQL syntax:

SELECT * FROM <connection>.<table_name>

Where:

  • <connection>: Your database connection name.
  • <table_name>: Database table name.

LimitationsLimitations

Working with MySQL® clusters comes with certain limitations.

  • External sources are available for read-only access via SELECT queries. Yandex Query does not currently support data-modifying queries against external sources.

  • YQ uses the Yandex Managed Service for YDB type system. However, the valid value ranges for YDB date and time types, i.e., Date, Datetime, and Timestamp, are often too narrow to accommodate the values of the corresponding MySQL® types, i.e., date, datetime, and timestamp. Therefore, YQ returns date and time values read from MySQL® as plain strings (Optional<Utf8>) in ISO-8601 format.

Filter pushdownFilter pushdown

Yandex Query can push parts of query processing down to the source data system by sending filter expressions, e.g., WHERE conditions, directly to the database. This approach is known as filter pushdown.

Filter pushdown is possible when using:

Description Example
NULL check WHERE column1 IS NULL or WHERE column1 IS NOT NULL
Logical operators AND, OR, NOT, and parentheses to control operator precedence WHERE column1 IS NULL OR (column2 IS NOT NULL AND column3 > 10).
Comparison operators =, ==, !=, <>, >, <, >=, and <= that compare a column with other columns or constants WHERE column1 > column2 OR column3 <= 10, WHERE column1 + column2 > 10, WHERE column1 = (10 + 10)

Other filter types do not support source pushdown: the external table rows are filtered on the federated Yandex Query side, i.e., Yandex Query will perform a full scan of the external table when processing the query.

Supported data types for filter pushdown:

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

Supported data typesSupported data types

In MySQL databases, the column nullability flag, i.e., whether or not the column can contain NULL values, is not part of the type system. The NOT NULL constraint for any column of any table is stored as an IS_NULLABLE value in the INFORMATION_SCHEMA.COLUMNS system table, i.e., at the table metadata level. Therefore, all MySQL® base types may contain NULL values by default, and within the YQ type system they must be mapped to optional types.

The table below shows the mapping of MySQL® types to Yandex Query types. Only the listed types are supported.

MySQL® data type Yandex Query data type
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 Yandex MPP Analytics for PostgreSQL databases
Next
Working with Managed Service for PostgreSQL databases
© 2026 Direct Cursus Technology L.L.C.