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 Stackhero documentation

Stackhero provides a ready-to-use MariaDB cloud service designed for production workloads. You get:

  • Unlimited connections and data transfers.
  • Built-in phpMyAdmin web interface for database management.
  • One-click updates for easy maintenance.
  • High performance and strong security on private, dedicated infrastructure.

Launch a fully managed MariaDB instance in minutes. Stackhero handles setup, updates, and security so you can focus on your application. Learn more about MariaDB cloud hosting.

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.