MariaDB: Exporting a MariaDB database
This documentation is part of the Advanced usage guide. You can view the complete guide here: How to configure, optimise, export, or import MariaDB data.
👋 Welcome to the Stackhero documentation!
Stackhero offers a ready-to-use MariaDB cloud solution that provides a host of benefits, including:
- Unlimited connections and transfers.
- phpMyAdmin web UI included.
- Effortless updates with just a click.
- Optimal performance and robust security powered by a private and dedicated VM.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's MariaDB cloud hosting solution!
You can use the mysqldump CLI from your computer to export a database. For step-by-step details, please refer to the section above.
Exporting a MariaDB database to your computer
To export a database from your Stackhero instance to your computer, use the following command:
mysqldump -u root -p -h <XXXXXX>.stackhero-network.com -P <PORT> <DATABASE> > <DATABASE>.sql
Be sure to replace <XXXXXX>.stackhero-network.com, <PORT>, and <DATABASE> with your own details. After you press Enter, mysqldump will prompt you for the root password. It will then export all tables from your database into the file <DATABASE>.sql.
Importing a MariaDB database to your server
To import a database from your computer to your Stackhero instance, use:
mysql -u root -p -h <XXXXXX>.stackhero-network.com -P <PORT> <DATABASE> < yourDump.sql
Simply replace yourDump.sql with the SQL file you wish to import into your Stackhero instance.