Revoke Mysql ALTER TABLE command specific privileges 5.6.44

Asked

Viewed 49 times

-1

I need to prevent a column from being removed accidentally while running an Migration in a Mysql database v5.6.44, so I thought about limiting privileges, but even removing the permission of "DROP" for a user, it is still possible to execute the command "ALTER TABLE DROP COLUMN".

I was following the reference doc: (https://dev.mysql.com/doc/refman/5.6/en/privileges-provided.html#priv_alter).

With this my question is: It is possible to limit the privileges of the ALTER TABLE command?

  • I went through a similar problem in Oracle , I thought a ddl Rigger , so I saw it is also possible in Mysql , Trigger prevents a "drop column" https://dev.mysql.com/logwork/task/? id=2418 , I ended up not having to use the Trigger https://answall.com/questions/455233/trigger-de-ddl-oracle-identificar-um-drop-column

  • I tried to follow the documentation syntax, but in the version I am using it is not accepting the DDL events, it accuses syntax error.

  • No use Mysql was in the similarity , but you have drop history in these cases !?

  • We have more risk, because of the ORM that we adopted creating Migrations by generating column drop instead of change, my team is ignoring this functionality for Prod and using only in dev, until we find a better solution.

1 answer

0

Try the following REVOKE command to disable the privilege:

REVOKE ALTER FROM *object* FROM *user*;
  • In that case, I can successfully revoke ALTER, but in my scenario I would need to revoke only ALTER that was used in conjunction with DROP

Browser other questions tagged

You are not signed in. Login or sign up in order to post.