0

I am creating a reporting server which will run certain reports.

The reports are created by me and saved as SQL files.

The reporting application has read/write access, for good reasons.

Is there a way I can deprivilege a SQL session so that when executing the SQL it will use less privileges for execution than the application has available?

0

If you use Roles to control access to your tables, you can set a "read-only" role after opening the database connection:

set role read_only_role; 

Where this role has select access on the target tables.

https://dev.mysql.com/doc/refman/8.0/en/set-role.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.