Permission to delete views but not delete tables

I want to create a user with permission to create and delete views, but not delete tables or databases. This is so that I can play while testing my views without the risk of accidentally deleting the table.

There is a GRANT CREATE VIEW privilege, but there seems to be no analogue to GRANT DROP VIEW . GRANT DROP obviously applies to databases, tables, and views.

Is this possible in MySQL?

+4
source share
1 answer

I am also doing this research, and the answer seems to be No. You can restrict DROP to only tables / views in a single database (or a group of databases matching the LIKE pattern). This will ensure that they cannot delete the entire database. Unfortunately, you cannot perform pattern matching in table / view names. This is either all tables / views (*) in these databases, or just explanations of the mentioned tables / views.

+4
source

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


All Articles