8

I'd like to use a script to monitor the replication status of a MySQL database like in this bash script: https://gist.github.com/wesdeboer/1791632

I'd like to create a user which will only be used to query the status of the replication. So basically this user would just need to run the command:

"SHOW SLAVE STATUS \G"

What is the minimum set of permissions I need to grant a user to allow this?

(Is this even something which can be GRANTed?

2 Answers 2

19

According to the MySQL Documentation on SHOW SLAVE STATUS\G

Either SUPER or REPLICATION CLIENT should do it. I would go with the minimum:

GRANT REPLICATION CLIENT ON *.* to user@host;
1
  • 1
    In recent versions of MariaDB you may need to use SLAVE MONITOR or REPLICA MONITOR instead of REPLICATION CLIENT Aug 5, 2022 at 13:05
0

You have to also GRANT SELECT in order to connect.

2
  • 3
    SELECT on what exactly?
    – mustaccio
    Oct 31, 2022 at 22:03
  • I did Select on the table that was replicating, without the select grant it would not allow to connect to the database and raise an error. After SELECT was granted was able to connect no problem, could possibly be cuz of the version of the database, I was using Maria db 10.
    – iaskakho
    Jun 6 at 19:02

Your Answer

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

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