Exporting and Importing MariaDB Databases

MariaDB is a community-developed fork of the MySQL relational database management system and is used at Opalstack to provide MySQL-compatible database services.

This document shows how to export data from, and import data to, your MariaDB databases on Opalstack. The examples use mydb as the database name, mydbuser as the database username, and mydb.sql as the filename for the imported/exported data - be sure to replace those values with the names of your own database and database user.

Exporting MariaDB Databases

You can export a MariaDB database by executing the following command in a SSH session on your Opalstack server:

mysqldump -p -u mydbuser mydb > mydb.sql

Enter your MariaDB database user password when prompted.

When the command is complete, the exported data will be stored in the file mydb.sql in your SSH session's current working directory.

Importing MariaDB Databases

You can import a MariaDB database by executing the following command in a SSH session on your Opalstack server:

mysql -p -u mydbuser mydb < mydb.sql

Enter your MariaDB database user password when prompted.

When the command is complete, the imported data will be stored in your mydb MariaDB database.