MariaDB: Dumping a MariaDB database

This documentation is part of the Advanced usage guide. View the full 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 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 dump a database. For step-by-step details, please see the section above.

To export a database from your Stackhero instance to your computer, you can use this 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.

To import a database from your computer to your Stackhero instance, you can use:

mysql -u root -p -h <XXXXXX>.stackhero-network.com -P <PORT> <DATABASE> < yourDump.sql

Just replace yourDump.sql with the SQL file you want to import into your Stackhero instance.