When I want to backup all of the MySQL databases on my server, I have been using this command:
The trouble is that this backs up the DB's all into one large file. That makes restoring an individual DB kind of annoying.Code:mysqldump --all-databases -u MYSQL_USERNAME -h MYQL_SERVER -pMYSQL_PASSWORD > mysql-backup-`date +'%Y%m%d-%H%M%S'`
Presence uses mysqlhotcopy to backup each database into it's own file:
Code:#!/bin/bash BACKUP_DIR=/tmp/backup for i in `/usr/bin/find /var/lib/mysql/* -type d -printf "%f\n"`;do /usr/local/bin/mysqlhotcopy --allowold -u root $i $BACKUP_DIR; done


LinkBack URL
About LinkBacks
Reply With Quote




Bookmarks