From dc7ee24e377fafedfb15c9466c3a03a01e780211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yavuz=20Ayd=C4=B1n?= Date: Tue, 12 Oct 2021 17:13:54 +0200 Subject: [PATCH] Update 'README.md' --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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