Backing Up and Restoring MySQL/MariaDB Databases Using SSH

For Linux Web Hosting packages

In this article, we'll show you how to back up and restore your database using the mysqldump tool.


You need a web hosting package with shell access.

Creating a Backup of a Database

mysqldump --no-tablespaces --user=dboXXXXXXX --password=geheimes_Passwort dbXXXXXXX > dbXXXXXXXX.sql 

You can find the connection data for your database right in your IONOS account.

Please Note: If your file names, passwords, or user names contain special characters, write these in single quotation characters, such as password='password'.

A SQL dump will now be created. It is a text file containing all the data and instructions required to restore the database in SQL format.

Restoring Databases from a Backup

To restore a database from a .sql file, run the mysql command in the shell as follows:

mysql --user=dboXXXXXXX --password=geheimes_Passwort dbXXXXXXX < dbXXXXXXXX.sql 

If the SQL dump is compressed in the gzip format, use the following command:

gunzip -c dbXXXXXXX.sql.gz | mysql --user=dboXXXXXXX --password=geheimes_Passwort dbXXXXXXX