How to Restore a Large MariaDB Backup from the Terminal

If you have a backup of a larger database and restoring it via PhpMyAdmin does not work, this can be achieved via the following command on the shell. To see the status of the restoring backup, we install the program pv. It allows us to see visual progress of the process, after starting the restore of the file.

apt-get install pv
user@example:~# pv db_c25database.sql.gz | gunzip | mysql -u c25database_name -p database_user

Now enter the password of the database user and the process starts.

iB 0:00:06 [ 122KiB/s] [===================================================================================================================>] 100%

Now you have restored the database from the backup.

Leave a Comment