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

RE: [cobalt-users] Mysql backup...



Hello,

How can i backup all the Databases and datas of MySQL (I'm currently running
3.23.40 on Raq3)
Wich files must i copy ?
How can i restore my backup ?
Is there a program or a script (perl, php) that can makes this for me ? (If
no it could be a good GPL project)

Thanks

Ramon LOPEZ


Ramon,

A low-tech approach (which is sometimes the best) is to set up a batch job
to run on your local PC to perform a MYSQLDUMP over I/P.  This is ONLY
recommended if you have a fixed IP because you have to set up a MySQL user
on your server that allows read from other than LOCALHOST.

1. Create a MySQL user on your server with ONLY READ permissions, limited to
your fixed IP
2. Create a BAT file on your local machine
3. Add a line like the following for each database you want to back up:
c:/mysql/bin/mysqldump -h www.mydomain.com -u
UserID -pPassword --add-drop-table MyDBName > c:/ServerDumps/MyDBName.sql

The path to mysqldump should be corrected for your local machine.  I use the
same version of MySQL on my local PC as I use on the server - don't know
what happens if you cross versions.

I pull dumps from databases just before I make drastic changes to table
structures as well, and this allows you to take a backup at any time.  With
proper scripting of your batch file, you could archive out older copies and
keep a constantly rotating backup.

Jay Fesco