Changes

Jump to navigation Jump to search
330 bytes added ,  11:41, 26 November 2014
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 ==
<source lang="bash">
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;
</source>

== Restore ==
<source lang="bash">
mysql $DB < $backup
</source>
4,558

edits

Navigation menu