diff --git a/README.md b/README.md index feb21f0..ec6002b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,39 @@ -# mysql-backup +# MySQL Backup -A basic script to backup mysql instance +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 |