diff --git a/README.md b/README.md index 67a88f3..a6127f5 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ NEWDB='my-testdb' BACKUPDIR='/var/backup/mysql/20211012-0010' ``` +TIP: You can change NEWDB to any other name if you wish to restore to an alternate database name! + Make sure you have a backup of the current database which will be replaced: ``` sudo mysqldump ${NEWDB} > /root/${NEWDB}-$(date +%Y%m%d).sql @@ -80,6 +82,4 @@ And now the actual recovery (Need to be in the same session! Do not enter this i sudo mysql -e 'DROP DATABASE IF EXISTS `'${NEWDB}'`' sudo mysql -e 'CREATE DATABASE `'${NEWDB}'`' for table in ${BACKUPDIR}/${DB}/*; do gunzip -c $table | sudo mysql ${NEWDB}; done -``` - -You can change NEWDB to any other name if you wish to restore to an alternate database name! \ No newline at end of file +``` \ No newline at end of file