# The MySQL connector

You can use this connector both for source and target endpoints.

## Source endpoint configuration

1. Select Connection settingsConnection type:

1. Under On-Premise, specify the connection properties:

• The Host IP address or FQDN to connect to.

• The Port for connection (3306 by default).

• CA certificate. Click Choose a file to upload a certificate file (public key) in PEM format or provide it as text.

2. Specify the database attributes:

• Username for connection to the Transfer service.

• Password for the database user.

2. Configure the Table filter if you need to transfer only specific tables. If you don't specify any of the settings below, all tables will be transferred.

• Included Tables. The Transfer service will transfer only the data from these tables. Specify the table names after the name of the database containing these tables as follows: database_name.target_table.

• Excluded tables. The data from the tables on this list won't be transferred. Specify the table names after the name of the database containing these tables as follows: database_name.excluded_table.

3. Configure Schema migration:

Tip

The default schema migration settings usually let you successfully perform a transfer. Change the settings of the initial and final stages of the transfer only if necessary.

The transfer is performed in two stages:

• Activation stage

This stage is performed on activation of the transfer, before snapshot or replication to create schema on the target.

You can select parts of the schema to be transferred at this stage.

By default, the Tables are transferred at start.

• Deactivation stage

This stage is performed at the end of the transfer upon its deactivation.

If the transfer is constantly working in replication mode (Increment and Snapshot and increment transfer types), then the final stage of the transfer will be performed only after the replication stops. You can choose which parts of the schema to migrate.

At this stage, it's assumed that when the transfer is deactivated, there is no writing activity on the source. For complete reliability, the source is set to read-only mode. The database schema on the target is brought to a state where it will be consistent with the schema on the source.

Note

When the transfer is restarted during the replication phase, the table schemas on the target are preserved. In this case, the service will transfer only the table schemas that are not in the target at the restart.

• Database timezone. Specified as IANA Time Zone Database identifier. The default timezone is Local, it corresponds to the MySQL server timezone.

## Target endpoint configuration

1. Under Connection settingsConnection type, specify the connection properties:

• IP or FQDN of the host to connect to.

• The Port for connection (3306 by default).

• CA certificate. Click Choose a file to upload a certificate file (public key) in PEM format or provide it as text.

1. Specify the database attributes:

• Username for connection to the Transfer service.

• Password for the database user.

2. Select a Cleanup policy. This policy allows you to select a way to clean up data in the target database when you activate, reactivate or reload the transfer:

• Don't cleanup: Do not clean. Select this option if you only perform replication without copying data.

• Drop: Fully delete the tables included in the transfer (default). Use this option to always transfer the latest version of the table schema to the target database from the source.

• Truncate: Execute the TRUNCATE command for a target table each time you run a transfer.

• Database timezone. Specified as IANA Time Zone Database identifier. You can also set the special Local timezone as a string. This timezone corresponds to the MySQL server timezone. The default timezone is Local.

• SQL modes enabled on the target server . The delimiter for multiple modes is the comma (,).

The default modes are the following:

NO_AUTO_VALUE_ON_ZERO,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION

• Check Disable constraints checks if you don't need these checks and want to speed up the replication.

• The Database schema for service tables specifies the database into which to place the tables with the service information.