Update 'README.md'
This commit is contained in:
parent
70704f9702
commit
dc7ee24e37
|
@ -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!
|
||||
```
|
Loading…
Reference in New Issue