Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Feb 2003 12:07:09 -0800
From:      "Daxbert" <daxbert_news@dweebsoft.com>
To:        "Brian Henning" <b1henning@hotmail.com>, "freebsd" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: backup
Message-ID:  <042501c2d2d2$52f5f0d0$0a0aa8c0@dweebsoft.com>
References:  <OE54hGvDpEDiOa7ddhl0000149b@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Hello-
> I would like to backup my cvs repository in case my system goes down or incase i
> want to move the repository. can i tar up the files in the root directory and
> save it on a cd?
> 
> I would also like to back up my mysql databases for the same reasons. can i tar
> those up for later use?
> 

Not sure about cvs... However, for mysql, you should use mysqldump.

# mysqldump -u {username} -p{password} {database} > ./{database}.`date +%Y%m%d-%H%M`.sql

This will give you a nice datestamped sql script 
to rebuild your database.  

However, this will only contain your database 
information and structure. You will also need a backup 
of the mysql database (users, permissions, etc).

# mysqldump -u root -p<mysql_root_password> mysql > ./mysql.`date +%Y%m%d-%H%M`.sql

A final option is too just backup all of the databases in one shot.

# mysqldump -u root -p<mysql_root_password> --all-databases > ./FULL.`date +%Y%m%d-%H%M`.sql

--daxbert

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?042501c2d2d2$52f5f0d0$0a0aa8c0>