0

Our corporate hosting server has had restricted SQL DB permissions for a very long time, but one of our end-user systems has started requiring a new DB permission, INDEX, which none of them have. I can manually grant the INDEX permission to every single database one at the time, but is there a better way to grant every user that has permissions on a database an additional privilege on each database they have permissions for?

Example:

User A has SELECT, UPDATE, DELETE on 35 databases, but now needs INDEX as well. I could go to each database that user A has access to, and manually grant it INDEX permissions, but that is a time-consuming method, and there are hundreds of users and hundreds of databases.

I have tried to run GRANT INDEX ON . to 'user_a', but since the user is not the root user, it doesn't have permissions at all to many databases, nor any of the system databases. (nor do I want any my users except the root user to have access to any of the system databases)

The problem is compounded in our case because we have well over a hundred users with access to 1 - 100 databases each, that all need to be granted INDEX on all of the databases they currently have some level of permission on, but not on any database they don't already have some permissions on.

3
  • roles where created so you can bundle 100+ users and keep the permissions to the same role. Don't forget set default role
    – danblack
    Commented May 4, 2020 at 23:59
  • you are using ansible/chef/puppet or some automation system to manage this right?
    – danblack
    Commented May 5, 2020 at 8:13
  • @danblack Unfortunately this is an older hosting server and has virtually no automation tools whatsoever beyond initial setup of accounts (which already has been adjusted to handle the demands for the new permission). In regards to roles, that seems more to help when many users need access to the same things, our problem is a bit of the inverse that while we have many users, they all have different things they access. i.e. no two users access the same database, but one user may have many databases. Commented May 6, 2020 at 0:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.