Skip to content

HOAIAN2/mysql-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mysql-backup

This is a Bash script to backup a MySQL or MariaDB database by exporting data from each table individually and running the backup commands in parallel for optimal speed.

This tool is depend on mariadb-dump or mysqldump so make sure that you have one of these tools installed on your system.

Prerequisites

  • mysqldump or mariadb-dump

Usage

Create config/backup.conf file

SERVER_TYPE=mariadb
MAX_JOBS=8

DB_HOST="localhost"
DB_USER="admin"
DB_PASSWORD="123456789"
DB_NAME="college-quiz-app"

DUMP_EXTRA_ARGS="--compress --skip-ssl --quick --single-transaction"

Run backup with config file

./backup.sh

Run restore with default mysql

time mysql --user=<ADMIN_BACKUP> --password=<PASSWORD> demo < <(cat /path/to/your/restore/*.sql)

About

Bash script to backup mysql /mariadb database in parallel for better performance

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages