mysql - Prevent database table row from delete and update -



mysql - Prevent database table row from delete and update -

this question has reply here:

protect row deletion in mysql 2 answers

i have database table want protect rows deleting , updating. using mysql database. how can prepare in phpmyadmin or sql syntax?

ex: prevent row id:18 delete , update:

you have various options.

session wise: if using innodb

set autocommit=0; update table set mainpage =1 id = 18; -- not commit until want release lock. -- if under myisam, -- think going lock whole table (to verified)

structural protection

create trigger before update/delete on table , raise error when :new.id = 18

mysql phpmyadmin

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -