MariaDB: Dumping a MariaDB database

This documentation is part of the Advanced usage guide. You can view the complete guide here: How to configure, optimize, export, or import MariaDB data.

👋 Welcome to the Stackhero documentation

Stackhero offers a ready-to-use MariaDB cloud solution with a range of benefits, including:

  • Unlimited connections and data transfers.
  • Built-in phpMyAdmin web interface.
  • One-click updates for simplified maintenance.
  • Optimal performance and enhanced security thanks to private, dedicated infrastructure.

Save time and make your life easier: it only takes 5 minutes to try Stackhero's MariaDB cloud hosting solution!

You can use the mysqldump CLI from your computer to dump a database. For more details, please refer to the section above.

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 information. 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.

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 want to import into your Stackhero instance.