Menu

"Lock tables" DB (mySQL) error?

Help
2003-04-23
2012-10-11
  • Jared White

    Jared White - 2003-04-23

    Hello everyone,

    I installed PhpWiki on my home computer (Mac OS X) and spent days tweaking it to perfection. Life was good. Then I uploaded all the files to my ISP's server (Red Hat Linux), and I'm having a terrible time getting it to work. After re-uploading the default, untweaked files, fiddling around with the database permissions for the nth time, etc., it still doesn't work. Life is bad. :(

    Here's the error message I'm getting when I try to go to the index page:

    --
    ib/WikiDB/backend/PearDB.php:681: Fatal[256]: wikidb_backend_mysql: fatal database error

    DB Error: unknown error

    (LOCK TABLES page WRITE,version WRITE,link WRITE,recent WRITE,nonempty WRITE [nativecode=1044 ** Access denied for user: 'xxxxxx@localhost' to database 'xxxxxx'])
    --

    I x'ed out the user and database names myself -- but they are correct. I've checked multiple times.

    Any help or ideas would be GREATLY appreciated!!!

    Thanks,

    Jared

     
    • Stuart Oderman

      Stuart Oderman - 2003-05-09

      I'm having the same problem.  I've ensured that the user has rights to insert, update, select and it all seems fine. I've run commands from the mysql command line and from phpmysqladmin and it all seems kosher.  Not sure what's going on.

       
      • Scot Hacker

        Scot Hacker - 2004-07-20

        Stuart, see the first post in this thread - the user owning the database has to have the rights to lock tables. Unusual, but necessary. Easiest way is to use phpMyadmin (or have your administrator do it):

        - On main screen, click Privileges and click Edit for the user

        - On next screen, look at the "Database-specific privileges" and click Edit for the right database.

        - On the next screen, click "Lock Tables" and then "Go."

        Try to load v 1.3.9 again and it will come right up.

         
    • Stuart Oderman

      Stuart Oderman - 2003-05-09

      Jared,

      I'm sure tha this will cause immense problems in the near future, but i got passed this hurdle until someone more knowledgable can tell us both where the problem is.  (I am assuming that you and I both need to have MySql user accountsthat have rights to lock tables and that neither of us do.)

      Anyhow, I went into PearDB.php and commented out all of the method bodies for the locking and unlocking code and voila.  It initialized.

      stu

       
    • Anonymous

      Anonymous - 2003-05-17

      I had to reinstall and had the same problem. To unlock the tables you need to insert: $this-> unlock; at line 23 in the PearDB.php file. Once up and running, remove this line.

       
    • Michael Blakeley

      I'm also working through this problem, and I think I have a solution. I suspect that anyone seeing this error will also be able to reproduce this command-line:

      $ mysql --database=XXX -u XXX -p
      Enter password:

      Welcome to the MySQL monitor.  Commands end with ; or \g.
      Your MySQL connection id is 237643 to server version: 4.0.12

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

      mysql> LOCK TABLES link WRITE;
      ERROR 1044: Access denied for user: 'XXX@localhost' to database 'XXX'
      mysql> quit

      The answer is to run mysql as an admin user and run "GRANT ALL PRIVILEGES ON XXX.* TO YYY" - where XXX is your db name and YYY is your user name. But you need some sort of admin priviliges to make that grant, so people in hosted environments may have problems.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.