Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    London England
    Posts
    8

    Unanswered: How to I lock a whole database?

    Hi,

    I'm building a mysql database which is accessed via JDBC. The database can have many users, but I want to simplify it by only allowing one user to connect to the database at a time. My Java application creates and holds onto a connection until it exits. I just need to know how to lock the whole database whilst somebody is connected! Any ideas?

    Cheerz,

    Steve.

  2. #2
    Join Date
    Feb 2004
    Location
    London England
    Posts
    8
    The best solution i've come up with is to change th mysql system variable max_connections to 0 which only allows one person access at a time.
    If anybody knows of a better solution then let me know!!

  3. #3
    Join Date
    Jan 2004
    Location
    Aberdeen
    Posts
    12
    I have set up two user accounts, an admin one which only I use and a general one which is used by everything else. Then when I wish to lock the database I drop the general account. When I wish to unlock the database, I recreate the account.

    Anyone else got other ways of doing it?
    Calum
    www.4-3-3.com
    Online football Management Game

Posting Permissions

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