List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:September 6 1999 8:38am
Subject:Re: Backup tabel
View as plain text  
On Mon, 1999-09-06 10:15:27 +0200, Ben-Nes Michael wrote:
> Subject: Backup tabel
[...]
> First I do LOCK TABLES tbl_name READ;
> Then i cp the tables
> Then i UNLOCK TABLES;
> 
> Is this true that i need to lock only the READ ?

Yes, to prevent that some thread changes a table while copying is
still in progress.  Because some data may be cached in memory, you
also need to issue FLUSH TABLES to be sure that all these changes are
actually written on disk.
So what you have to do (with a single connection to MySQL!) is:

   LOCK TABLES tbl_name READ;
   FLUSH TABLES;
   then copy the table files
   UNLOCK TABLES;

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
Backup tabelBen-Nes Michael6 Sep
  • Re: Backup tabelMartin Ramsch6 Sep
  • Re: Backup tabelBen-Nes Michael6 Sep
    • Re: Backup tabelMartin Ramsch6 Sep
  • Re: Backup tabelBen-Nes Michael9 Sep
    • Re: Backup tabelMartin Ramsch9 Sep
  • Re: Backup tabelBen-Nes Michael9 Sep
    • Re: Backup tabelMichael Widenius9 Sep
  • MySQL: User Privledgesmtweito9 Sep
    • Re: MySQL: User PrivledgesMartin Ramsch9 Sep
RE: MySQL: User PrivledgesJohn Millaway9 Sep
  • Re: MySQL: User Privledgesmtweito9 Sep
  • Re: MySQL: User Privledgesmtweito9 Sep
RE: MySQL: User PrivledgesJohn Millaway9 Sep
  • Re: MySQL: User Privledgesmtweito9 Sep
RE: MySQL: User PrivledgesJohn Millaway9 Sep
  • RE: MySQL: User Privledgessinisa9 Sep
    • Re: MySQL: User PrivledgesBenjamin Pflugmann9 Sep
      • Re: MySQL: User Privledgessinisa10 Sep
        • get_lockA. Brandic10 Sep
          • Re: get_lockMartin Ramsch10 Sep
          • Re: get_locktonu10 Sep
RE: MySQL: User PrivledgesJohn Millaway9 Sep
RE: MySQL: User PrivledgesJohn Millaway9 Sep
  • Re: MySQL: User PrivledgesChristian Mack13 Sep