0

We have a support team member who we'd like to limit his access to our database. He has never caused any problems with UPDATE or DELETE but we'd like to limit him to SELECT/SHOW/etc if it's possible. Is there a way? I'm not talking about limiting the number of queries, but the types of queries he can run.

1

2 Answers 2

1

Use GRANT to give them the exact authority that you would like them to have. It sounds like they may only need SELECT. For global authority use:

GRANT SELECT ON *.* TO 'supportmember'@'localhost';

Or limit the authority to a specific database using:

GRANT SELECT ON specificdatabase.* TO 'supportmember'@'localhost';

Or to a specific table in a specific database:

GRANT SELECT ON specificdatabase.specifictable TO 'supportmember'@'localhost';

1

In addition to @Dave's answer, if you would like to give this user the equivalent of SHOW VARIABLES then you would give him SELECT on Performance Schema System Variable Tables too.

If there is a more limited subset of data you would like him to see, then you can create views that execute as the definer and give him SELECT on the view only, so he would have no access to the underlying tables. This would enable you to filter by rows too if necessary.

Your Answer

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

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