This page describes how to configure the following source database instances for continuous homogeneous MySQL migrations:
- Cloud SQL for MySQL
- Self-hosted MySQL
- Amazon RDS for MySQL
- Amazon Aurora for MySQL
- Microsoft Azure Database for MySQL
Configure a Cloud SQL for MySQL source
To configure a Cloud SQL for MySQL source instance for your migration process, do the following:
- Check if your source database contains metadata defined by users
with the
DEFINERclause. See Verify metadata with aDEFINERclause.Database Migration Service for homogeneous MySQL migrations doesn't migrate user accounts and logins. Sources that contain metadata defined by user accounts with the
DEFINERclause might block your migration. - If your source database contains objects that reference
tables in the
mysql,performance_schema,information_schema,ndbinfo, orsyssystem schemas, ensure that the replica databases also contain these system schema tables.If the replica databases don't have these tables, your migration job might fail with the
Unknown table in system schema. -
Enable and configure binary logs on your source database.
In Cloud SQL for MySQL, binary logging is enabled automatically when you use point-in-time recovery (PITR). You can configure the log format and retention period with the system flags available in Cloud SQL. Do the following:
- Enable PITR on your instance. This feature automatically enables binary logging. It isn't possible to enable binary logging without PITR in Cloud SQL. See Point-in-time recovery (PITR) in the Cloud SQL documentation.
- Use Cloud SQL flags to adjust logging configuration.
For more details, see
Configure database flags
in the Cloud SQL documentation.
- Database Migration Service requires that
binlog_formatis set toROW. You don't need to adjust this setting, Cloud SQL for MySQL automatically sets thebinlog_formatflag toROW. - Set the
log retention period to a long enough period to support the
database migration. Generally, a week is sufficient.
Use one of the following flags:
- MySQL 5.6 - 5.7:
expire_logs_days - MySQL 8.0 and later:
expire_logs_days,binlog_expire_logs_seconds
- MySQL 5.6 - 5.7:
- Database Migration Service requires that
-
Create a dedicated migration user account in your instance. See Create a user in the Cloud SQL documentation. Make sure that:
- You allow the dedicated user account to connect from any host
(
host=%). - The password for the account doesn't exceed 32 characters in length. For more information about the MySQL user password length limitations, see MySQL Bug #43439.
- You allow the dedicated user account to connect from any host
(
-
Assign the necessary privileges to the dedicated migration user account. For continuous migrations, the full list of required privileges depends on whether you provide your own dump files or use Database Migration Service managed dump feature:
Managed dump
If you want Database Migration Service to automatically take the full dump of your source database, assign the following privileges to the user account:
REPLICATION SLAVEEXECUTEREPLICATION CLIENTSELECTSHOW VIEWTRIGGERRELOAD- For source MySQL versions 8.0 or later: Make sure the migration account
doesn't have the
BACKUP_ADMINprivilege.
Manual dump
If you provide your own dump files created with
mysqldump, you need to provide the privileges required for the CDC phase:
Configure a self-hosted MySQL source
To configure a self-hosted MySQL source instance for your migration process, do the following:
- Ensure that all your tables (except tables in system databases) use the InnoDB storage engine. If you use a different storage engine, you might need to convert your tables. For more information, see Converting Tables from MyISAM to InnoDB.
- Check if your source database contains metadata defined by users
with the
DEFINERclause. See Verify metadata with aDEFINERclause.Database Migration Service for homogeneous MySQL migrations doesn't migrate user accounts and logins. Sources that contain metadata defined by user accounts with the
DEFINERclause might block your migration. - If your source database contains objects that reference
tables in the
mysql,performance_schema,information_schema,ndbinfo, orsyssystem schemas, ensure that the replica databases also contain these system schema tables.If the replica databases don't have these tables, your migration job might fail with the
Unknown table in system schema. - Configure the
server-idsetting to a value of1or larger. For more information, see Replication and Binary Logging Options and Variables. -
Make sure that
GTID_MODEis set toONorOFF, no other value is supported.Database Migration Service requires
GTID_MODEset toONin the following scenarios:- When you migrate to an existing destination instance that has read replicas enabled.
- If you want to set up cascading read replicas after you complete the migration process.
- If you plan to manually create the dump files and provide them in the migration job.
For more information about
GTID_MODE, see Global Transaction ID System Variable. -
Enable and configure binary logs on your source database. Do the following:
- Enable binary logs on your source database.
- Set
binlog_formatto'ROW'. See Row-based binary logging. - Set the
log retention period to a long enough period to support the
database migration. Generally, a week is sufficient.
Use one of the following flags:
- MySQL 5.5 - 5.7:
expire_logs_days - MySQL 8.0:
expire_logs_days,binlog_expire_logs_seconds
- MySQL 5.5 - 5.7:
-
Create a dedicated migration user account in your instance. See Account management statements. Make sure that:
- You allow the dedicated user account to connect from any host
(
host=%). - The password for the account doesn't exceed 32 characters in length. For more information about the MySQL user password length limitations, see MySQL Bug #43439.
- You allow the dedicated user account to connect from any host
(
-
Assign the necessary privileges to the dedicated migration user account. For continuous migrations, the full list of required privileges depends on whether you provide your own dump files or use Database Migration Service managed dump feature:
Managed dump
If you want Database Migration Service to automatically take the full dump of your source database, assign the following privileges to the user account:
REPLICATION SLAVEEXECUTEREPLICATION CLIENTSELECTSHOW VIEWTRIGGER- For sources with
GTID_MODE = ONsetting:RELOADWith the managed dump flow, Database Migration Service requires the
GTID_MODE = ONsetting only when you migrate to an existing destination instance that has read replicas enabled. - For source MySQL versions 8.0 or later: Make sure the migration account
doesn't have the
BACKUP_ADMINprivilege.
Manual dump
If you provide your own dump files created with
mysqldump, you need to provide the privileges required for the CDC phase:
Configure an Amazon RDS for MySQL source
To configure an Amazon RDS for MySQL source instance for your migration process, do the following:
- Amazon RDS for MySQL uses InnoDB storage engine by default, but allows using other storage engines. Ensure that all your tables (except tables in system databases) use the InnoDB storage engine. If you use a different storage engine, you might need to convert your tables. For more information, see Converting Tables from MyISAM to InnoDB.
- Check if your source database contains metadata defined by users
with the
DEFINERclause. See Verify metadata with aDEFINERclause.Database Migration Service for homogeneous MySQL migrations doesn't migrate user accounts and logins. Sources that contain metadata defined by user accounts with the
DEFINERclause might block your migration. - If your source database contains objects that reference
tables in the
mysql,performance_schema,information_schema,ndbinfo, orsyssystem schemas, ensure that the replica databases also contain these system schema tables.If the replica databases don't have these tables, your migration job might fail with the
Unknown table in system schema. -
Make sure that
GTID_MODEis set toONorOFF, no other value is supported. Amazon RDS for MySQL usesGTID_MODE = OFFby default.Database Migration Service requires
GTID_MODEset toONin the following scenarios:- When you migrate to an existing destination instance that has read replicas enabled.
- If you plan to manually create the dump files and provide them in the migration job.
For more information about
GTID_MODE, see Global Transaction ID System Variable. -
Verify and configure binary logs on your source database. Do the following:
- Ensure your instance uses automated backups. Amazon RDS generates binary logs only when automated backups are enabled. For more information, see Enabling automated backups in the Amazon RDS documentation.
-
Set the log retention period to a long enough period to support the database migration. Generally, a week is sufficient. See Setting and showing binary log configuration in the Amazon RDS documentation.
- Restart your server so that the changes you made can take effect.
-
Create a dedicated migration user account in your instance. See Account management statements. Make sure that:
- You allow the dedicated user account to connect from any host
(
host=%). - The password for the account doesn't exceed 32 characters in length. For more information about the MySQL user password length limitations, see MySQL Bug #43439.
- You allow the dedicated user account to connect from any host
(
-
Assign the necessary privileges to the dedicated migration user account. For continuous migrations, the full list of required privileges depends on whether you provide your own dump files or use Database Migration Service managed dump feature:
Managed dump
If you want Database Migration Service to automatically take the full dump of your source database, assign the following privileges to the user account:
REPLICATION SLAVEEXECUTEREPLICATION CLIENTSELECTSHOW VIEWTRIGGERLOCK TABLES- For sources with
GTID_MODE = ONsetting:RELOADWith the managed dump flow, Database Migration Service requires the
GTID_MODE = ONsetting only when you migrate to an existing destination instance that has read replicas enabled. - For source MySQL versions 8.0 or later: Make sure the migration account
doesn't have the
BACKUP_ADMINprivilege.
Manual dump
If you provide your own dump files created with
mysqldump, you need to provide the privileges required for the CDC phase:
Configure an Amazon Aurora for MySQL source
To configure an Amazon Aurora for MySQL source instance for your migration process, do the following:
- Check if your source database contains metadata defined by users
with the
DEFINERclause. See Verify metadata with aDEFINERclause.Database Migration Service for homogeneous MySQL migrations doesn't migrate user accounts and logins. Sources that contain metadata defined by user accounts with the
DEFINERclause might block your migration. - If your source database contains objects that reference
tables in the
mysql,performance_schema,information_schema,ndbinfo, orsyssystem schemas, ensure that the replica databases also contain these system schema tables.If the replica databases don't have these tables, your migration job might fail with the
Unknown table in system schema. -
Make sure that
GTID_MODEis set toONorOFF, no other value is supported. Amazon Aurora for MySQL usesGTID_MODE = OFFby default.Database Migration Service requires
GTID_MODEset toONin the following scenarios:- When you migrate to an existing destination instance that has read replicas enabled.
- If you plan to manually create the dump files and provide them in the migration job.
For more information about
GTID_MODE, see Global Transaction ID System Variable. -
Enable and configure binary logs on your source database. Do the following:
- Enable binary logging for your MySQL database.
-
Set the log retention period to a long enough period to support the database migration. Generally, a week is sufficient. See Setting and showing binary log configuration.
- Restart your server so that the changes you made can take effect.
-
Create a dedicated migration user account in your instance. See Account management statements. Make sure that:
- You allow the dedicated user account to connect from any host
(
host=%). - The password for the account doesn't exceed 32 characters in length. For more information about the MySQL user password length limitations, see MySQL Bug #43439.
- You allow the dedicated user account to connect from any host
(
-
Assign the necessary privileges to the dedicated migration user account. For continuous migrations, the full list of required privileges depends on whether you provide your own dump files or use Database Migration Service managed dump feature:
Managed dump
If you want Database Migration Service to automatically take the full dump of your source database, assign the following privileges to the user account:
REPLICATION SLAVEEXECUTEREPLICATION CLIENTSELECTSHOW VIEWTRIGGERLOCK TABLES- For sources with
GTID_MODE = ONsetting:RELOADWith the managed dump flow, Database Migration Service requires the
GTID_MODE = ONsetting only when you migrate to an existing destination instance that has read replicas enabled. - For source MySQL versions 8.0 or later: Make sure the migration account
doesn't have the
BACKUP_ADMINprivilege.
Manual dump
If you provide your own dump files created with
mysqldump, you need to provide the privileges required for the CDC phase:
Configure a Microsoft Azure Database for MySQL source
To configure a Microsoft Azure Database for MySQL source instance for your migration process, do the following:
- Check if your source database contains metadata defined by users
with the
DEFINERclause. See Verify metadata with aDEFINERclause.Database Migration Service for homogeneous MySQL migrations doesn't migrate user accounts and logins. Sources that contain metadata defined by user accounts with the
DEFINERclause might block your migration. - If your source database contains objects that reference
tables in the
mysql,performance_schema,information_schema,ndbinfo, orsyssystem schemas, ensure that the replica databases also contain these system schema tables.If the replica databases don't have these tables, your migration job might fail with the
Unknown table in system schema. -
Make sure that
GTID_MODEis set toONorOFF, no other value is supported. Microsoft Azure Database for MySQL usesGTID_MODE = OFFby default.Database Migration Service requires
GTID_MODEset toONin the following scenarios:- When you migrate to an existing destination instance that has read replicas enabled.
- If you plan to manually create the dump files and provide them in the migration job.
For more information about
GTID_MODE, see Global Transaction ID System Variable. -
Verify and configure binary logging settings on your source database. Do the following:
- Binary logging is enabled by default on Microsoft Azure Database for MySQL. You don't need to enable it, but confirm that the feature is enabled. For more information, see the Microsoft documentation.
-
Set
binlog_expire_logs_secondsto a period that is long enough to support the database migration. Generally, a week is sufficient.For more information, see Configure server parameters in Azure Database for MySQL and the
binlog_expire_logs_secondsparameter in the Microsoft documentation. - Restart your server so that the changes you made can take effect.
Check the value of your
require_secure_transportsetting.By default, Microsoft Azure databases require SSL/TLS encryption for all incoming connections. Depending on the
require_secure_transportvalue, use one of the following encryption settings when you create the source connection profile:- If
require_secure_transportis set toon, select Basic, TLS, or mTLS. - If
require_secure_transportis set tooff, select None.
- If
-
Create a dedicated migration user account in your instance. See Account management statements. Make sure that:
- You allow the dedicated user account to connect from any host
(
host=%). - The password for the account doesn't exceed 32 characters in length. For more information about the MySQL user password length limitations, see MySQL Bug #43439.
- You allow the dedicated user account to connect from any host
(
-
Assign the necessary privileges to the dedicated migration user account. For continuous migrations, the full list of required privileges depends on whether you provide your own dump files or use Database Migration Service managed dump feature:
Managed dump
If you want Database Migration Service to automatically take the full dump of your source database, assign the following privileges to the user account:
REPLICATION SLAVEEXECUTEREPLICATION CLIENTSELECTSHOW VIEWTRIGGER- For sources with
GTID_MODE = ONsetting:RELOADWith the managed dump flow, Database Migration Service requires the
GTID_MODE = ONsetting only when you migrate to an existing destination instance that has read replicas enabled. - For source MySQL versions 8.0 or later: Make sure the migration account
doesn't have the
BACKUP_ADMINprivilege.
Manual dump
If you provide your own dump files created with
mysqldump, you need to provide the privileges required for the CDC phase:
What's next
To get a complete, step-by-step migration walkthrough for homogeneous Cloud SQL for MySQL migrations, see Get started with Cloud SQL for MySQL migrations.