Database Error :lock tables

Discuss here how to configure hoteldruid and better use its features.

Moderator: marco

Post Reply
Slavenska
Posts: 1
Joined: Wed Nov 30, 2005 6:58 am

Database Error :lock tables

Post by Slavenska »

Hi Marco

First of all congratulations and thanks to make our live a litbit easier!

ERROR IN: lock tables prenota2005 write,soldi2005 write,personalizza read
1044: Access denied for user: "xxx" to database "yyyyyy"

I change the pconnect and resolve the conection problem but this still hapens. It the same in differents pages, and different tables. maybe the permissions are wrong?

Any sugestions?

Slav
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

Maybe the database user doesn't have the privileges to lock tables. You can change those with phpmyadmin or if you can send queries as root user try this one:

GRANT ALL PRIVILEGES on databasename.* to user@localhost IDENTIFIED BY 'pass';

Did you get the same problem as Adam? I still haven't been able to reproduce it, maybe it is a configuration or hardware problem. What's your environment (easyphp on windows, linux distribution)?

Marco
adam
Posts: 14
Joined: Fri Sep 02, 2005 2:34 pm

Post by adam »

Hi Both

It sounds like your having the same error as me... but I changed pconnect to connect and since then (touch wood) I have had not problems!!!

A
m4d
Posts: 22
Joined: Wed Aug 09, 2006 11:32 am

Post by m4d »

I have the same error ... ERROR IN: lock tables

Did you find a solution ?
m4d
Posts: 22
Joined: Wed Aug 09, 2006 11:32 am

Post by m4d »

the problem comes from the mysql privileges … Can we use an another instruction ? Thanks
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

The mysql user must have lock privileges, for this problem you should ask your own hosting provider.

Marco
mrice
Posts: 3
Joined: Fri Jan 26, 2007 8:22 pm

Post by mrice »

I just installed PHP-Residence, all is working fine except that on every page I receive this error:

ERROR IN: lock tables anni read,prenota2007 read,ntariffe2007 read,periodi2007 read,appartamenti read,clienti read,regole2007 read,personalizza read
1044: Access denied for user 'user'@'localhost' to database 'db'
situation at 12:29 of 26/1/2007

I know that the username/database are correct because it actually makes the changes, but for some reason it can't lock the tables? The user has all privileges on the appropriate database, and I even tried giving that use all privileges to the mysql database but nothing helped.

Am I missing a table in my mysql database?


mysql> show tables;
+-----------------+
| Tables_in_mysql |
+-----------------+
| columns_priv |
| db |
| func |
| host |
| tables_priv |
| user |
+-----------------+

Any help would be appreciated
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

The user must have LOCK privileges. Have you tried this query (from the README)?

GRANT ALL PRIVILEGES on databasename.* to user@localhost IDENTIFIED BY 'pass';

changing databasename, user and pass with your data.

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
mrice
Posts: 3
Joined: Fri Jan 26, 2007 8:22 pm

Tried grant all

Post by mrice »

Yes I ran that exact query, I even tried doing Grant All on the mysql database, but that didn't work either.

Could there be something wrong with my server(mysql) settings?

-Matt
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

Hello Matt,
try this query:

GRANT LOCK TABLES on databasename.* to user@localhost IDENTIFIED BY 'pass';

If it doesn't work you should discuss this issue with your hosting provider.

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
mrice
Posts: 3
Joined: Fri Jan 26, 2007 8:22 pm

It must be a mysql problem

Post by mrice »

I tried the above and got this result:
"Query OK, 0 rows affected (0.03 sec)"

I looked in my db table under mysql database and found that I was missing a Lock_tables_priv variable so I looked around and we have 4.1.2 installed, I'm fairly sure that something is wrong with the privilege schema.

Even though the requirements for php-residence state that you need mysql >=3.23.49 there is something wrong/missing with my installation.

I am my hosting provider, I directly manage my own servers so the next step is to update mysql!
Post Reply