SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Feb 2004
    Location
    Rome
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [php and mysql] how to LOCK TABLES ?

    Hello

    using a php script , I would execute a

    LOCK TABLES (only read)
    FLUSH TABLES

    for database "mydatabase" , on ALL the tables .

    Any idea how to do that please ?

    I need this to make the database read only (for backup of mysql files purpouse)

    Thank you

  2. #2
    Coding and Breathing CoderMaya's Avatar
    Join Date
    Feb 2008
    Location
    Atlit, Israel
    Posts
    470
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would just create a new MySQL user with specific permissions.
    Learn about the new Retro Framework
    Code PHP the way it was meant to be coded!

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    any particular reason you're reinventing the wheel? mysqldump already takes the proper locks.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •