MySQL sauvegarde

Dump et restauration

Dump de database

mysqldump -u username -p DB_name > DB_name_save.sql

Restore via dump de la base

mysql -u username -p  DB_name < DB_name_save.sql

Dump avec plus d’options

mysqldump -u username -p  --single-transaction --flush-logs --events --ignore-table=mysql.event --all-databases > full_backup_db.sql

Compression du dump

mysqldump -u username -p  --single-transaction --flush-logs --events --ignore-table=mysql.event --all-databases | gzip > full_backup_db.sql.gz