Write once, read many mysql fields

Can you restrict updating a field without granting additional user rights?

Basically, a value in a string can only be set during an insert statement.

+6
source share
4 answers

You can use the update trigger to prevent the value from updating.

+3
source

Yes. If you grant only insert and select privileges. How:

 grant select, insert, update(message, time) on hibtest.message to 'worm'@'localhost' identified by 'worm' 

... that way, the user can update the message and time columns.

+7
source

Mysql distinguishes between insert privileges and update privileges, which will give the user the ability to insert, but not upgrade later.

see this link: http://dev.mysql.com/doc/refman/5.5/en/privileges-provided.html

+1
source

Not suitable for your question: if you run mysqlisampack in a table, the table will become read-only.

This is good if you have a datawharehouse, which is just a link, but not very good if you just want to make a live column read-only.

0
source

Source: https://habr.com/ru/post/886149/


All Articles