Best way to lock a whole mySQL table ?

jbv at souslelogo.com jbv at souslelogo.com
Sun Jan 7 15:45:22 EST 2024


Hi list,
I have a mySQL table with over a million rows and I would
like to lock the data so that no inserts nor updates are
possible, only reads via select commands.
I have read the doc as well as numerous blogs, and as far
as I understand, the following command
LOCK TABLES myTable WRITE;
locks the table and prevents other users from reading or
writing to the table.
But that's not what I need : I need to allow any user to
read at any time, but prevent anyone to write at any time.
Besides, I also need the lock to be effective in phpMyAdmin.
And of course, I need to do that for 1 table only and not
the other tables in the db.

How can I achieve that ? Does the solution have to do
with the user privileges ?

Thank you in advance.
jbv



More information about the use-livecode mailing list