http://worldcommunity.com/opensource/utilities/mysql_backup.html

I've heard great things about this script and I'm just about to start using
it myself.

-Dan

-----Original Message-----
From: Scott Haneda [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 11:31 PM
To: MySql
Subject: Update databases, the unanswered question


Hello all, I have dug through the archives to no avail, the archives point
to many ways to back up your databases, I have found a way that works for
me, but it is no where near as automated as what I want it to be, so I
thought I would ask a few people here what the best approach would be.

To start with, my first question,
Mysqldump has a option to dump all databases to a file, this logically seems
the simplest way, and is close to what I want to do, however, it dumps all
databases to one file.  My question is, in the event I had to restore a
database from this type of dump, would I also be restoring ALL databases?
If this is the case, this is not the option I am looking for, I anticipate a
client calling and telling me they accidentally deleted a whole bunch of
records, and want a restore from a few days ago.  If I have to restore ALL
databases, I would be messing up a whole lot of clients databases.  When you
restore, does mysql ask you which database you want to restore even if the
dump file has tons of other information in it?  If not....

The approach I have been using now is this...
I have a small shell script that cron calls, in it is
mysqldump -u backup my_database | gzip > /path_to_storage_$newtime.sql.gz

I have many entries like this where I change "my_database" with the correct
database name.

You will also notice I do not have a password in there, is that safe?  I
have created a user with select only privileges just for backup, what is the
best way to pass a username and password for these types of purposes?

And finally, the main question,
mysql> show databases;
+-------------------+
| Database          |
+-------------------+
| dsadsadsad        |
| ewrererrewrerr    |
| 324effdfdfd       |
| liffdfdsfewfdsake |
| mysql             |
+-------------------+

As you can see, it is rather simple to get a real up to date list of all
databases, but it is bordered by bars, +'s and -'s, is there any way to
issue a show databases with a flag that tells it to return the database
names in a list, perhaps comma separated or better yet \r separated.  This
way, I can create a shell script that will loop through all the databases,
and when I add new databases I need not ever worry about messing with my
backup script.

Any suggestions of pre-made scripts that would work under OS X would be much
appreciated.

-------------------------------------------------------------
Scott Haneda                                Tel: 415.898.2602
http://www.newgeo.com                       Fax: 313.557.5052
[EMAIL PROTECTED]                            Novato, CA U.S.A.


---------------------------------------------------------------------
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