Mysqldump
Revision as of 11:41, 26 November 2014 by Freephile (talk | contribs) (Created page with "quick recipe on using mysqldump == Backup == <source lang="bash"> DB=wiki backupdir="$HOME/backups"; if [ ! -d "$backupdir" ]; then mkdir -p $backupdir; fi backup="$backupd...")
quick recipe on using mysqldump
Backup[edit | edit source]
DB=wiki
backupdir="$HOME/backups";
if [ ! -d "$backupdir" ]; then
mkdir -p $backupdir;
fi
backup="$backupdir/dump-$(hostname)-$DB.sql";
/usr/bin/mysqldump $DB > $backup;
ls -al $backup;
Restore[edit | edit source]
mysql $DB < $backup