Linux Programmer | RHCE | RHCSA

Search This Blog

Friday, 12 November 2021

record delete restriction trigger

DELIMITER $$
CREATE TRIGGER trigger_name
BEFORE DELETE
ON table_name
FOR EACH ROW
BEGIN
    if SUBSTRING_INDEX(USER(),'@',1) NOT IN ('root') THEN
        CALL cannot_delete_error;
    END if;
END
$$

No comments:

Post a Comment

SSH not working with password after upgrade ubuntu 22.04 or above

In recent upgrade of ubuntu 22.04 and above we are not able to login server with SSH password. but when we try to login with key then it all...