I'm using MariaDB. I have a set of entity tables like order, inventory etc and other audit tables order_audit, inventory_audit to track any changes made to the original tables. I do not want to allow database user that is being used by the Java application to have DELETE
or UPDATE
permissions on audit tables.
I could assign permissions in following way
grant select,insert,update,delete on my_db_name.* to 'my_app_db_user';
But the above query grants update and delete permissions to audit tables as well. I did a quick search and figured its not possible to use patterns on table names in MySQL.
Most of the solutions suggest using a different database for such tables that require different permissions. But since my audit tables belong to original tables, I don't like them in a separate database. Is there any workaround ?