Overview
In this article, you’ll learn how to migrate a database from MariaDB, a fork of MySQL, into PlanetScale. We recommend reading through the Database import documentation to learn how our import tool works before proceeding.Prerequisites
- A PlanetScale account
- A MariaDB server with traffic permitted from our import tool IP addresses
Configure MariaDB
Before you can start migrating data, there are a number of configuration options that need to be in place for our import tool to work properly:binlog_formatlog_binsql_mode
/etc/mysql/mariadb.conf.d/50-server.cnf. Edit the configuration file and add the following values at the end of the file:
systemctl:
Configure a migration account
The PlanetScale import tool requires a user account with a specific set of permissions on the database you wish to migrate, as well as the server itself to set up the necessary database that tracks replication changes. To create a user namedmigration_user, run the following:
migration_user to set up replication:
<DATABASE_NAME> with the name of your database in MariaDB:
ps_import_<id> (the last portion of the name will vary) that will be created by the import tool to track replication between MariaDB and PlanetScale.
Importing your database
Now that your MariaDB database is configured and ready, follow the Database Imports guide to complete your import. When filling out the connection form in the import workflow, use the following information:- Host name - Your MariaDB server hostname or IP address
- Port - 3306 (default for MariaDB)
- Database name - The exact database name to import
- Username -
migration_user(created in previous section) - Password - The password you set for the migration user
- SSL verification mode - Select based on your MariaDB SSL configuration
- Creating your PlanetScale database
- Connecting to your MariaDB database
- Validating your configuration
- Selecting tables to import
- Monitoring the import progress
- Switching traffic and completing the import

