문제

I am new to Databases. I wanted that updates in the database happen only through a stored procedure. The end-user does not have GRANT UPDATE but has a GRANT EXECUTE ON PROCEDURE.

I tried it this way but figured out that the end-user needed to have a UPDATE permission. Is there any other way in which this can be achieved?

도움이 되었습니까?

해결책

According to the doc:

Any user who has the EXECUTE privilege for p1 can invoke it with a CALL statement. However, when p1 executes, it does so in DEFINER security context and thus executes with the privileges of 'admin'@'localhost', the account named in the DEFINER attribute. This account must have the EXECUTE privilege for p1 as well as the UPDATE privilege for the table t1. Otherwise, the procedure fails.

So you should be able to set the DEFINER to the authorized user account and only give your end users the ability to execute the procedure.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top