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

Re: [cobalt-developers] Who can I backup and restore MYSQL database on my RaQ?



"Carlos F. Moreno" <cmoreno@xxxxxxxxxxxxx> wrote:
> Who can I backup and restore MYSQL database on my RaQ?
>
> Anyone knows what are the steps to backup a mysql database and restore
> it?

The preferred method is to use the program "mysqldump" which is included in
the MySQL distribution and should be on your server if MySQL is installed.
It has benefits over copying the database files directly since it:

1. Creates dump files of SQL statements which are portable to any system and
can be used to easily re-create databases.
2. Will not create corrupt backup copies like will happen if you do a
regular copy of a database file when it's being written to (via an UPDATE,
INSERT, etc.).
3. FYI, to avoid #2 using a regular copy you have to turn off the MySQL
server which is not ideal in a production environment.  mysqldump can be run
against a live database with no problems.

mysqldump --help for usage instructions or search the MySQL mailing list
archives at www.mysql.com.  Once you have a dump file you restore it by
doing:

mysql < dump_file

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/