SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot DaisyChain's Avatar
    Join Date
    Aug 2002
    Location
    Manchester, England
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Locked tables in MySQL

    Does anyone know how to unlock tables in MySQL when the connection is lost (it was a mysql_pconnect )? I was running a script that locked a couple of tables in my database. This script was interupted before it ran the UNLOCK TABLES query. Now I can't access any of the site that links to the database and when I try to access the tables directly though MySQL-Front it just freezes.
    Have tried to run a new script with an UNLOCK query but it hasn't worked (I'm guessing because its not the same connection).

    Is my only option to ask for the server to be restarted?

    I'd be grateful for any suggestions cos I'm stumped!

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    Palo Alto
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you've got privileges, you can try the kill command. It takes a process ID, which you can get using SHOW PROCESSLIST.

  3. #3
    SitePoint Zealot DaisyChain's Avatar
    Join Date
    Aug 2002
    Location
    Manchester, England
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks brainpipe. I'm not sure if I have the privileges for that but I can give it a go! Could you talk me through it as I've not used that command before?

  4. #4
    SitePoint Zealot
    Join Date
    Jul 2003
    Location
    Palo Alto
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll be glad to help, but you probably won't need me. Check out http://www.mysql.com/doc/en/KILL.html for info on how to do this.

  5. #5
    SitePoint Zealot DaisyChain's Avatar
    Join Date
    Aug 2002
    Location
    Manchester, England
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I took the plunge and killed the offending threads(Was a bit worried about making matters worse then they already were!) Thanks for your help - my site is now up and running again.


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
  •