Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    907
    Thanks
    301
    Thanked 2 Times in 2 Posts

    Exclamation How to test table locking?

    Hi

    I have been reading this tutorial to learn how to read/write lock a table.

    But I wish to know how do I test it?

    I ran the command

    Code:
    LOCK TABLE users WRITE;
    The above code should ideally lock the table for reading/writing to other connections. But when I open phpmyadmin in another browser, i can still read the data of that table.

    Is there anyway to test if its working?

    Database: MySQL 5.1.41-3
    Table Type: MyISAM

    Thanks in advance

  • #2
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,959
    Thanks
    120
    Thanked 76 Times in 76 Posts
    .....
    Quote Originally Posted by cancer10 View Post
    Code:
    LOCK TABLE users WRITE;
    But when I open phpmyadmin in another browser, i can still read the data of that table.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • Users who have thanked BubikolRamios for this post:

    phantom007 (06-13-2011)

  • #3
    Regular Coder
    Join Date
    Jun 2006
    Location
    UK
    Posts
    907
    Thanks
    301
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by BubikolRamios View Post
    .....
    I know what are you pointing to..but according to Mysql manual:

    If you specify WRITE, the current connection can read or write to the table, but no other connections can access the table until the lock has been removed.


  •  

    Posting Permissions

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