330 bytes added
, 11:41, 26 November 2014
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>