Best way to lock a whole mySQL table ?

matthias_livecode_150811 at m-r-d.de matthias_livecode_150811 at m-r-d.de
Sun Jan 7 15:50:42 EST 2024


You could set user permissions and allow only select.

https://simplebackups.com/blog/how-to-create-and-grant-permissions-to-a-mysql-user/

Regards,
Matthias

> Am 07.01.2024 um 21:45 schrieb jbv via use-livecode <use-livecode at lists.runrev.com>:
> 
> 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
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list