-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonas --

...and then Jonas Widarsson said...
% 
%  Hello world!

Hi!


% Every attempt I have made to find a decent way of backing up a database 
% ends up with tons of reading to show hundreds of ways to do database 
% backups.

Heh :-)  And you expect less from a mailing list?


% 
% I want to know which way to do complete backups is most commonly used by 
% professional users. (Windows and Linux)

I can't speak for Windows, but I can speak for Linux -- or at least count
as a voice.  There is, of course,, more than one way to do it :-)


% 
% I have pleasant experience from Microsoft SQL Server 2000 where backung 
% up is very confident, easy to understand and just a matter of a mouse click.

"Gosh, that sounds terrible.  Only one way to back up?  Having to use a
mouse?  Who would want that?"

Perhaps that casts some light on the UNIX "philosophy": have small tools
that do few things and do them well, and then interconnect them to make
whatever you need.


% 
% Is there any similarily convenient way to do this with mysql, for example:
% * a shell script (windows / Linux) that works as expected without days 
% of configuration?
% * scheduled backups, complete or differential?
% * GUI-solution ??? (mysql control center does not even mention the word 
% backup)

I don't know about similar, but definitely convenient.  A little shell
script to do your backup (using whatever means you like; more in a
moment) and a cron job (think "task scheduler" if you are not familiar
with cron) to run the script periodically.

So you have to figure out how you want to back up the database.  You
might generate an sql dump of the whole thing with mysqldump and save
the results to a file (on disk or on a tape).  You might connect to the
database, lock the tables, copy the filesystem files themselves, and then
unlock.  You might store the files on mirrored disks and then temporarily
break the mirror and back up from the quiet copy.  You might set up a
slave server to replicate the database and then back up *that* version
instead.

Our needs are simple; I use mysqldump.  I've created a database user
(let's call it backups for this example, because I didn't really) with
SELECT privileges on everything so that it can read every column of every
row of every table of every database in the system.  Then I just run

  OUT=`date +%Y-%m-%d`
  mysqldump --user=backups --opt --all-databases | \
    gzip -9 > \
    /path/to/backups/dump.$OUT.sql.gz

once a day and there we go.  I won't write a password in a shell script
file, but I *would* like to have a secure way of authenticating the user,
like "only root@localhost can connect as dumper@localhost" through some
certificate or the like, but I haven't gotten around to that yet.


% 
% Backup is such an important issue. Why does it seem like it is something 
% that the developers don't care about?

Well, there again you're crossing functionality...  The developers care
about the database engine and how to get data in and out quickly; backup
is an entirely separate issue.  Yes, it's important, but it's very much a
different animal -- and so it shouldn't be part of the same package.


HTH & HAND

mysql query,
:-D
- -- 
David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE+Gz1FGb7uCXufRwARAibPAKDm6kfYnl1RzI107xS/juKLQBwfQgCgtFOf
MbIB7v9bZgjMRJOjKAtjznU=
=+W9p
-----END PGP SIGNATURE-----

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