5

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.

2 Answers 2

8

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
1
  • 2
    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, 2012 at 17:25
7

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .