On Monday 04 February 2002 03:46, Robert Nagle wrote:
> I realize this is a very elementary question and explained somewhat in
> the mysql manual.
>
> The manual describes three different methods for backing up databases
>
> Copying the files themselves
> using mysqldump to dump all the tables into a single file
> using mysqlhotcopy
>
> The most straightforward way from an admin's point of view is just to
> copy the directories containing the tables.

Except that mysql won't know there's a database in the new directory.
And the only way to tell it (that I know) is to CREATE TABLE.
Which means recreating the schema, the data, and then the indices.
And you have to lock the tables and flush them first.
Look in the archives for my simple script for all this, it also
works better than the next two solutions.

http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:mss:96818:200201:eakgpmohmnggidifgola

> I couldn't get mysqlhotcopy to work on first try, but mysqldump did
> exactly as advertised.

Yes it does, but if you have a really big database it's not much help,
since your text dump will be 
(a) too big to fit on your hard drive and
(b) devoid of indexes, which may then require days to regenerate.

My script or monty's mysqlhotcopy works better.  
Mysqlhotcopy has the same functionality
as my nameless script but is written in Perl with DBI (which I found a pain 
to get running on a Redhat system with their stupid RPM).  It's also got
way too many options for my taste.  

And yes, I used the code of mysqlhotcopy to make sure I wasn't forgetting
something crucial.  And tested on a honking big database with lots of indexes 
and over 3GB data, 3GB index files.

Best wishes,
Steve

> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]> Trouble
> unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to