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 that the MySQL DBMS versions match. We do not guarantee migration between different versions. For more information, see 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 or IP address;<port>— port for connecting to the database;--set-gtid-purged=off— the flag specifies that GTID-based replication is not used;--no-tablespaces— disables adding service information to the dump, which requires additional privileges to access. This information does not affect user data and can be excluded from the dump;--single-transaction— creating an SQL dump as a single transaction;<database_name>— database name.
Restore a database from an SQL dump
Restore the database from an 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 or IP address;<database_name>— database name.
If you are 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 or IP address;<database_name>— database name.