Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What is the minimum set of privileges that mytop requires in order to work, without actually requiring super-user privileges.

I feel uncomfortable with the fact that I have to save the password in the configuration file (the less desirable alternative would be the command line), so I want to minimize the impact, should someone get to see the password. The password will still be used only in this one place, but I would prefer to not give unneeded privileges to the (MySQL) user mytop is running as.

The mytop documentation doesn't mention any of that and all examples assume root.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

As far as I can tell all you need is enough to run SHOW PROCESSLIST and SHOW STATUS on the mysql server, which should mean that you only need USAGE, and PROCESS.

So create an account like so.

grant usage,process on *.* to 'mytop'@'%' identified by 'mypassword';

If you don't want to save your password, then use the command line. This command will login as the user mytop, and prompt you for a password so it doesn't get store in your history or the process list.

mytop -u mytop --prompt
share|improve this answer
    
Thanks a bunch for the answer. –  0xC0000022L Dec 8 '11 at 17:54
    
Note that you'll need the SUPER privilege for some functionality, such as killing threads. But you probably want to not enable this normally. –  Will Glass Apr 24 '12 at 17:25
add comment

I've found I also need to grant SELECT on mysql.* to have mytop actually succeed, in addition to the usage, process referenced above.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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