On Fri, 17 Aug 2001, hanan khader wrote:

> Hi everybody
>   I want to make backing up for my databases from the server into my pc, I
> login to the server with the administrator username and password, how could
> this backing up be done? and is there any risk that i should be aware of ?
> is there any softwares that could be used for administrator managemnet or
> shall we still keep using the command prompt ?

You can run "mysqldump" to get a local copy of the CREATE TABLE and INSERT
statements needed to re-create the tables. This is the easiest way, but if
your database is tens of megabytes or larger, it takes longer than it
should.

The other option is to copy the data files (.MYD, .FRM) directly from the
MySQL data directories. In order to get a consistent snapshot of those
files, you need to flush the buffers (only MySQL root can flush) and lock
the tables first. You'll also have to use a UNIX user that can read the
data files directly. So what you could do is something like:

- open MySQL connection to remote host as MySQL user "root"
- open FTP connection to remote host as UNIX user "mysql"
- execute LOCK TABLES on all the tables you want to get
- execute FLUSH TABLES
- download the .MYD and .FRM files via FTP
- execute UNLOCK TABLES
- close the FTP and MySQL connection

You can replace rsync with FTP in order to transfer the file faster on
subsequent backups. Note that while you're waiting for the FTP to
complete, the tables will remain locked so no one else can use them. If
this would take too long, then you should LOCK TABLES, copy the data files
to another location on the same system (should only take a few seconds),
UNLOCK TABLES, then FTP the copied data files.


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