1

I want to disable mysqldump command for all user's including root. As I am taking DB snapshot.

After removing mysqldump binary file from /usr/bin/ location. But is it safe to do so?

coder
  • 13
  • 3
  • 1
    Why would that make `mysqldump` redundant? Did you try to move it from that location to see what breaks? As an example backup tools or scripts could be using it. – Seth Feb 01 '18 at 09:06
  • @Seth As per my company requirement no user should execute mysqldump command. I have not found any option to disable mysqldump command. So I remove binary from /use/bin – coder Feb 01 '18 at 09:09

1 Answers1

0

This command will prevent anyone, including root, from executing mysqldump:

sudo chmod -x /usr/bin/mysqldump

This command will make mysqldump executable again for anyone:

sudo chmod +x /usr/bin/mysqldump

You could alternatively remove /usr/bin/mysqldump, but it could easily be replaced without your knowledge during a software update. Or if you end up needing it again, you'd have to reinstall it.


Additional Resources

Deltik
  • 19,353
  • 17
  • 73
  • 114
  • Thanks for the point that mysqldmup can be replaced after update. As after chmod -x /usr/bin/mysqldump I was still able to execute the mysqldump command so I changed command to chmod ogu-x /usr/bin/mysqldump and it works. – coder Feb 01 '18 at 09:26