Networker

Re: [Networker] Mysql

2009-03-13 18:36:11
Subject: Re: [Networker] Mysql
From: Yaron Zabary <yaron AT ARISTO.TAU.AC DOT IL>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Sat, 14 Mar 2009 00:26:42 +0200
  This is our Wiki page on that subject:

Backup of MySQL database

The following script should run from cron:

 #!/bin/bash
 D=`date +%Y%m%d%H%M`
mysqldump --add-drop-table --all-databases -uroot -ppass | gzip -9 > /var/mysqlbackup/backup.$D.gz

This script is suitable for relatively small databases (a few GBytes worth of data) because it basically does a full backup every day. For larger databases, the right way is to setup a full every month and backup the logs every day. This procedure is described in the MySQL manual.

Backup Individual Databases from a MySQL server

mysqldump --add-drop-table -uroot -ppass DB_NAME1 DB_NAME2 DB_NAME3 | gzip -9 > /var/mysqlbackup/backup.dbname.gz

Restore MySQL database

gunzip < [backupfile.gz] | mysql -uroot -ppass [dbname]

* when restoring a single db to a new machine, (migrating dbs) its required to "GRANT PRIVILEGES" for the relevant users in the target MySQL server

Ólafur Þ. Sveinbjörnsson wrote:
Hi, I was  wondering if anybody knows if there is a backupsolution for Mysql 
from Networker ?

Best Regards

_________________________________________


Olafur Sveinbjornsson
System Manager

Corparate Solutions

System Service

Skýrr

olafur.sveinbjornsson AT skyrr DOT is <mailto:olafur.sveinbjornsson AT skyrr DOT is>
ots AT skyrr DOT is
<mailto:stefan.hrafn.hagalin AT skyrr DOT is> 354 822 7668

354 569 5226
http://www.skyrr.is
<http://www.skyrr.is/> _________________________________________

http://www.skyrr.is/legal/disclaimer.txt
<http://www.skyrr.is/legal/disclaimer.txt>

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the body of the email. Please write to networker-request 
AT listserv.temple DOT edu if you have any problems with this list. You can access the 
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER


--

-- Yaron.

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the body of the email. Please write to networker-request 
AT listserv.temple DOT edu if you have any problems with this list. You can access the 
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

<Prev in Thread] Current Thread [Next in Thread>