V3.0 table lock error

cfapress wrote on Monday, March 09, 2009:

With a fresh install of v3.0rc1 I tried to create a new patient with the admin user. I can enter the new patient’s name data but when I submit the form, to create the new patient, I get a database error:

"
ERROR: query failed: lock tables patient_data read

Error: Access denied for user ‘oemr30’@‘localhost’ to database ‘oemr30’
"

It seems we might need to add the specific privileges to lock the tables to our database scripts:
http://dev.mysql.com/doc/refman/5.0/en/privileges-provided.html#priv_lock-tables
http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html

Clearly, this line in the setup.php should have taken care of that:
(mysql_query(“GRANT ALL PRIVILEGES ON $dbname.* TO ‘$login’@’$loginhost’ IDENTIFIED BY ‘$pass’”,$dbh)

It’s odd that it didn’t. Maybe it’s some setting on my machine?

During the set up I created a new database (oemr30) with a new user account (oemr30).

Jason

cfapress wrote on Monday, March 09, 2009:

As a follow up to myself…

Two hours later, without changing any code, I’m able to add a new patient without trouble.

I believe it has something to do with flushing privileges and perhaps the MySQL daemon restarting. I’m not certain.  :frowning:

Jason