[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MYSQL backup question



* John Griffiths (john@capmon.com) wrote:
> Hello all,
> 
> How do i go about backing up and then recovering a mysql database

Depends on a number of factors.  What version of MySQL are you running? How critical is your DB?
Version 3.23.X you can take advantage of mysql's internal replication, set up a slave machine and forget about it.
Version 3.22 is a little different.  The easiest way, IMHO, is to (if allowable) shut down mysql tar/bzip the directory
/usr/local/mysql/your_database/ and restart the database.  If you're not running mission critical stuff then this is the best way.  To restore just unpack this archive over the old corrupted one, run an isamchk -s or myisamchk -s and you shouldn't see any errors.  IF you are mission critical you can still do this, you will see errors like (error file changed while archiving), it's not a perfect back up.  Depending on your data flow you might loose a few rows or a few thousand.  But it will work, just untar it back, this time run myisamchk -s (or isamchk -s) and be prepared to have to run isamchk -q -r to repair the tables.

> 
> i tried
> 
> #mysqldump -p --all --add-drop-table foo >/home/john/foo.sql
> 
> then to recover
> 
> #mysqladmin create -p fooa < foo.sql 
> 
> it creates ok but then the php application i run yeilds bad results....
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 



Reply to: