Re: to backup mysql,what file should I copy?



somez72 wrote:
> Hi,
> 1)
> I'd like to know,
> to bakcup mysql, which data file is related to mysql?
> what is real data file for mysql?
>
I do not know about mysql, but I do know about other dbms's. It is better to
use the backup tools _in the dbms_ to backup a dbms. For one thing, it is
not always easy to know what files are involved; with IBM's DB2 dbms, for
example, there are roughly two files per relation (one for the data, one for
the index) plus other ones for the ddl, etc.

For another thing, if the dbms is running, your backup will have
synchronization problems (the files backed up will almost certainly be
inconsistent).

Thirdly, there will almost certainly be problems with commitment if you
restore from such backups. Certain transactions marked committed may not be,
or those not marked committed may be, and your data will go to hell and you
will never find it.

I assume you would have the same problems with mysql. So best bet is to find
out how to tell mysql to backup the data base(s).

> 2) if I have table which has two columns.
> for example )
> id int (11)
> name char (20)
>
> How many record can be saved in this table?
> namely, what is max number of record for one table?

Normally you can have any number of tuples (rows, records) in a table. The
main issue on small machines (i.e., 32-bit machines) is the maximum size of
a file (assuming a separate file is used for each table in the database,
which is typical but perhaps not universal). With IBM's DB2, you put tuples
(rows, records) into pages, and pages can be 4K, 8K, 16K, or 32K bytes each,
and a few of those bytes are for overhead, so in the case of 4K pages, only
4005 bytes can be used for the attributes (i.e., columns), not all 4096, and
for variable length attributes, the overhead is higher still.

Now if mysql uses the normal Linux file system for IO, the maximum number of
tuples (rows, records) will be determined by the maximum file size allowed.
I suppose that is 2^32 bytes or so. If mysql uses raw IO (bypassing the ext2
or ext3 file system stuff), the maximum size might be larger because it
might be that the dbms can use the space differently. It would depend on
just what the disk driver in the kernel could do (and I do not know anything
about that) or whether the dbms would divide such a relation into multiple
"files" automatically.

--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ PGP-Key: 9A2FC99A Registered Machine 241939.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 07:45:00 up 29 days, 18:17, 5 users, load average: 4.38, 4.28, 4.24
.



Relevant Pages

  • Re: How to create my own VB backup program for a remote MySQL DB
    ... MySQL has an OLEDB driver, ... Both data and schema are stored in the output file. ... the recordset to an open connection, call UpdateBatch and ADO and the server ... > I understand that the basic principles to create a TCP/IP backup program ...
    (microsoft.public.vb.database)
  • Re: [opensuse] Moving the database directories
    ... (I'm already kicking off the apps from a script to backup the data after ... I close the app - but if the backup doesn't work than I'm back to square ... For MySQL I would not copy/move the physical files... ... Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org ...
    (SuSE)
  • Re: [OT] Database synchronisation
    ... There's a thing on phpclassess which claims to replicate MySQL schemas (you ... Both DBMS are different so I’m accessing data through ODBC drivers. ... Failing that why not just shutdown the DBMS and transfer the files across - ... you need a timestamp and primary key field on every table. ...
    (comp.lang.php)
  • Upgrade: MySQL Auto Backup 1.28
    ... Download MySQL Auto Backup at http://www.swordsky.com to help you. ... Backups your data automatically from MySQL Database Server ... Save task log to TXT file and save task log to LOG file. ...
    (php.general)
  • Re: Access als Frontend für verschiedene DBMS testen
    ... >> Diese DBMS habe ich mir angesehen: JET, MSSQL, PostgreSQL 8.0, MySQL ... Datentypen im FE erkannt? ... Warum ich PostgreSQL vor MySQL stellte: ...
    (microsoft.public.de.access)