Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
Yandex Data Transfer
  • Available transfers
  • Getting started
  • Step-by-step guide
    • All instructions
    • Preparing for the transfer
    • Configuring endpoints
      • Endpoint management
      • Configuring source endpoints
      • Configuring target endpoints
        • Apache Kafka®
        • ClickHouse
        • Greenplum®
        • MongoDB
        • MySQL
        • Object Storage
        • PostgreSQL
        • Yandex Managed Service for YDB
    • Managing the transfer process
    • Working with databases during the transfer
    • Monitoring the transfer status
  • Practical guidelines
  • Concepts
  • Troubleshooting
  • Access management
  • Pricing policy
  • API reference
  • Questions and answers
  1. Step-by-step guide
  2. Configuring endpoints
  3. Configuring target endpoints
  4. MySQL

Configuring a MySQL target endpoint

Written by
Yandex Cloud
  • Managed Service for MySQL cluster
  • Custom installation
  • Additional settings

When creating or editing an endpoint, you can define:

  • Yandex Managed Service for MySQL cluster connection or custom installation settings, including those based on Yandex Compute Cloud VMs. These are required parameters.
  • Additional parameters.

Managed Service for MySQL cluster

Connecting to the database with the cluster ID specified in Yandex Cloud. Available only for clusters deployed in Yandex Managed Service for MySQL.

Management console
CLI
Terraform
API
  • MDB cluster ID: Select the cluster to connect to.

  • Security groups: Select the cloud network to host the endpoint and security groups for network traffic.

    This will let you apply the specified security group rules to the VMs and clusters in the selected network without changing the settings of these VMs and clusters. For more information, see Network in Yandex Data Transfer.

  • Database name: Specify the name of the database in the selected cluster. Leave the field empty if you want to create tables in databases with the same names as on the source. In this case, explicitly specify a DB schema for service tables under additional settings.

  • Username: Specify the username that Data Transfer will use to connect to the database.

  • Password: Enter the user's password to the database.

  • Endpoint type: mysql-target.
  • --cluster-id: ID of the cluster you need to connect to.

  • --database — Database name. Leave the field empty if you want to create tables in databases with the same names as on the source. In this case, explicitly specify a DB schema for service tables under additional settings.

  • --user: Username that Data Transfer will use to connect to the database.

  • To set a user password to access the DB, use one of the following parameters:

    • --raw-password: Password as text.

    • --password-file: The path to the password file.

  • Endpoint type: mysql_target.
  • connection.mdb_cluster_id: ID of cluster to connect to.

  • database — Database name. Leave the field empty if you want to create tables in databases with the same names as on the source. In this case, explicitly specify a DB schema for service tables under additional settings.

  • user: Username that Data Transfer will use to connect to the database.

  • password.raw: Password in text form.

Example configuration file structure:

resource "yandex_datatransfer_endpoint" "<endpoint name in Terraform>" {
  name = "<endpoint name>"
  settings {
    mysql_target {
      security_groups = [ "list of security group IDs" ]
      connection {
        mdb_cluster_id = "<Managed Service for MySQL cluster ID>"
      }
      database = "<name of database being transferred>"
      user     = "<username for connection>"
      password {
        raw = "<user password>"
      }
      <advanced endpoint settings>
    }
  }
}

For more information, see the Terraform provider documentation.

  • mdbClusterId: ID of the cluster you need to connect to.

  • database — Database name. Leave the field empty if you want to create tables in databases with the same names as on the source. In this case, explicitly specify a DB schema for service tables under additional settings.

  • user: Username that Data Transfer will use to connect to the database.

  • password.raw: Database user password (in text form).

Custom installation

For OnPremise, all fields are filled in manually.

Management console
CLI
Terraform
API
  • Database port: Set the number of the port that Data Transfer will use for the connection.

  • CA Certificate: Upload the certificate file or add its contents as text if encryption of the transmitted data is required, for example, to meet the PCI DSS requirements.

  • Host IP or FQDN: Enter the IP address or FQDN of the master host to connect to.

  • Subnet ID: Select or create a subnet in the desired availability zone.

    If the source and target are geographically close, connecting over the selected subnet speeds up the transfer.

  • Security groups: Select the cloud network to host the endpoint and security groups for network traffic.

    This will let you apply the specified security group rules to the VMs and clusters in the selected network without changing the settings of these VMs and clusters. For more information, see Network in Yandex Data Transfer.

  • Database name: Specify the name of the database in the selected cluster. Leave the field empty if you want to create tables in databases with the same names as on the source. In this case, explicitly specify a DB schema for service tables under additional settings.

  • Username: Specify the username that Data Transfer will use to connect to the database.

  • Password: Enter the user's password to the database.

  • Endpoint type: mysql-target.
  • --host: IP address or FQDN of the master host you want to connect to.

  • --port: Number of the port that Data Transfer will use for the connection.

  • --ca-certificate — If the transmitted data needs to be encrypted, for example, to meet the requirements of PCI DSS.

  • --subnet-id: ID of the subnet the host resides in.

  • --database — Database name. Leave the field empty if you want to create tables in databases with the same names as on the source. In this case, explicitly specify a DB schema for service tables under additional settings.

  • --user: Username that Data Transfer will use to connect to the database.

  • To set a user password to access the DB, use one of the following parameters:

    • --raw-password: Password as text.

    • --password-file: The path to the password file.

  • Endpoint type: mysql_target.
  • on_premise.hosts: List of IPs or FQDNs of hosts to connect to. Since only single-item lists are supported, specify the master host address.

  • on_premise.port: Port number that Data Transfer will use for connections.

  • on_premise.tls_mode.enabled.ca_certificate: CA certificate if the data to transfer must be encrypted to comply with PCI DSS requirements.

  • on_premise.subnet_id: ID of subnet that host is on.

  • database — Database name. Leave the field empty if you want to create tables in databases with the same names as on the source. In this case, explicitly specify a DB schema for service tables under additional settings.

  • user: Username that Data Transfer will use to connect to the database.

  • password.raw: Password in text form.

Example configuration file structure:

resource "yandex_datatransfer_endpoint" "<endpoint name in Terraform>" {
  name = "<endpoint name>"
  settings {
    mysql_target {
      security_groups = [ "list of security group IDs" ]
      connection {
        on_premise {
          hosts = ["<host list>"]
          port  = <connection port>
        }
      }
      database = "<name of database being transferred>"
      user     = "<username for connection>"
      password {
        raw = "<user password>"
      }
      <advanced endpoint settings>
    }
  }
}

For more information, see the Terraform provider documentation.

  • onPremise: Database connection parameters:
    • hosts — IP address or FQDN of the master host to connect to.

    • port: The number of the port that Data Transfer will use for the connection.

    • tlsMode: Parameters for encrypting transmitted data if it is required, for example, to meet PCI DSS requirements.
      • disabled: Disabled.
      • enabled: Enabled.
        • caCertificate: CA certificate.
    • subnetId: ID of the subnet the host resides in.

  • database — Database name. Leave the field empty if you want to create tables in databases with the same names as on the source. In this case, explicitly specify a DB schema for service tables under additional settings.

  • user: Username that Data Transfer will use to connect to the database.

  • password.raw: Database user password (in text form).

Additional settings

Warning

You can configure Cleanup policy and DB schema for service tables only via the management console.

Management console
CLI
Terraform
API
  • Cleanup policy: Select a way to clean up data in the target database before the transfer:

    • Drop: Fully delete tables included in the transfer (default).

      Use this option so that the latest version of the table schema is always transferred to the target database from the source whenever the transfer is activated.

    • Disabled: Do not clean.

      Select this option if only replication without copying data is performed.

    • Truncate: Delete only the data from the tables included in the transfer but leave the schema.

      Use this option if the schema in the target database differs from the one that would have been transferred from the source during the transfer.

  • DB time zone: Specify the IANA Time Zone Database identifier. The server's local time zone is used by default.

  • SQL modes: Specify the settings that override the standard MySQL behavior.

  • Disable constraint checks: Used to speed up replication: the FOREIGN_KEY_CHECKS and UNIQUE_CHECKS settings are set to 0 (no checks are performed).

    Warning

    Disabling constraint checks will speed up replication but may affect data integrity when using cascading operations.

  • Database schema for auxiliary tables: Specify the name of the schema where service tables needed for the transfer operation will be created.

  • sql_mode: Specify the settings that override the MySQL standard behavior.

  • --skip-constraint-checks: Used to speed up replication: the FOREIGN_KEY_CHECKS and UNIQUE_CHECKS settings are set to 0 (no checks are performed).

    Warning

    Disabling constraint checks will speed up replication but may affect data integrity when using cascading operations.

  • --timezone: Specify the IANA Time Zone Database identifier. Defaults to UTC+0.

  • sql_mode: Specify settings to override standard MySQL behavior. The following list is used by default: NO_AUTO_VALUE_ON_ZERO,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION.

  • skip_constraint_checks: Used to speed up replication: the FOREIGN_KEY_CHECKS and the UNIQUE_CHECKS values are set to 0 (no checks are performed).

    Warning

    Disabling constraint checks will speed up replication but may affect data integrity when using cascading operations.

  • timezone: Specify the IANA Time Zone Database identifier. Defaults to UTC+0.

For more information, see the Terraform provider documentation.

  • sqlMode: Specify the settings that override the MySQL standard behavior.

  • skipConstraintChecks: Used to speed up replication: the FOREIGN_KEY_CHECKS and UNIQUE_CHECKS settings are set to 0 (no checks are performed).

    Warning

    Disabling constraint checks will speed up replication but may affect data integrity when using cascading operations.

  • timezone: Specify the IANA Time Zone Database identifier. Defaults to UTC+0.

Was the article helpful?

Language / Region
Yandex project
© 2023 Yandex.Cloud LLC
In this article:
  • Managed Service for MySQL cluster
  • Custom installation
  • Additional settings