A basic script to backup mysql instance
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Dryusdan 6dc9be6235 Correction of retention 1 week ago
LICENSE Initial commit 1 month ago
README.md Improve readme 1 month ago
mysqlbackup.sh Correction of retention 1 week ago

README.md

MySQL Backup

A basic script to backup mysql instance

How it work

MySQL backup list your databases. On each database, MySQL Backup lists tables, dumps schemas and data on two separate files on each tables.

In databases folder, you will find the structure for each database and each table. In extras folder, you will find the routine, trigger and event of your database. In schemas folder, you will find each table structure per file. In datas folder, you will find each table data per file.

How use it ?

Create a backup user with these grants : SELECT, RELOAD, LOCK TABLES, REPLICATION CLIENT, SHOW VIEW, EVENT, TRIGGER

Download mysqlbackup.sh. Execute script with good parameters Take a coffee

su - mysqlbackup
cd ~
wget https://git.drycat.fr/Dryusdan/mysql-backup/raw/branch/master/mysqlbackup.sh
chmod +x mysqlbackup.sh
./mysqlbackup.sh /empty/folder/for/mysqldump 7 backup S3c4ET 127.0.0.1
Parameters Explain
Folder Folder where dumps were stored. This folder must be empty
Retention Time on the day before dropping a dump
Username Username of you're mysql's backup user
Password Password of you're mysql's backup user
Host You're MySQL Host. Default is 127.0.0.1
Port You're MySQL Port. Default is 3306