Overview
In this article, you’ll learn how to migrate a database from MariaDB, a fork of MySQL, into PlanetScale.The steps outlined in this guide used MariaDB version 10.6.12 on an Ubuntu host. Depending on the version of MariaDB you are using, your results may vary. Don’t hesitate to reach out to us for further assistance.
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_format
log_bin
sql_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
In the PlanetScale dashboard, click “New database”, then “Import database”.

migration_user
credentials configured in the previous section along with the name of your database. In this demo, I’m moving a database named “bookings_db”. Advanced security options are available if needed, but will not be utilized in this demo.

NoteIf your database uses foreign key constraints, we will detect them after successfully connecting to your external database and automatically enable foreign key constraint support for your database.


