Migration of MySQL databases to MySQL sync Managed Databases
You can migrate data from your MySQL database to Managed Databases:
- Create an SQL dump.
- Restore the database from the SQL dump.
Only InnoDB is supported.
For your information
Before migrating, make sure the MySQL DBMS versions match. We do not guarantee migration between different versions. Learn more in the official documentation.
Create an SQL dump
Create an SQL dump of the database using the mysqldump utility:
mysqldump --user=<user_name> \
--password=<password> \
--host=<host> \
--port=<port> \
--set-gtid-purged=off \
--no-tablespaces \
--single-transaction <database_name> > dump.sql
Specify:
<user_name>— source database username;<password>— database user password;<host>— node DNS name or IP address;<port>— port for connecting to the database;--set-gtid-purged=off— the option specifies that GTID-based replication is not used;--no-tablespaces— suppresses the addition of service information to the dump that requires additional privileges to access. This information does not affect user data and can be excluded from the dump;--single-transaction— creates an SQL dump within a single transaction;<database_name>— database name.
Restore the database from an SQL dump
Restore the database from the SQL dump using the mysql utility:
mysql --user=<user_name> \
--password=<password> \
--host=<host> \
--port=6033 <database_name> < dump.sql
Specify:
<user_name>— cloud database username;<password>— database user password;<host>— node DNS name or IP address;<database_name>— database name.
If connecting with an SSL certificate, specify the additional parameters --ssl-ca and --ssl-mode:
mysql --user=<user_name> \
--password=<password> \
--host=<host> \
--port=6033 \
--ssl-ca=~/.mysql/root.crt \
--ssl-mode=required <database_name> < dump.sql
Specify:
<user_name>— cloud database username;<password>— database user password;<host>— node DNS name or IP address;<database_name>— database name.