yoshinorim / mha4mysql-manager

Development tree of Master High Availability Manager and tools for MySQL (MHA), Manager part
http://code.google.com/p/mysql-master-ha/
GNU General Public License v2.0
1.47k stars 501 forks source link

Document MHA DB User Requirements #60

Open gwittel opened 8 years ago

gwittel commented 8 years ago

Per this old bug: https://code.google.com/p/mysql-master-ha/issues/detail?id=50

It would be good to know what grants are required for MHA user. When we tested against MariaDB 5.5 we found the following grants were required:

CREATE USER mha IDENTIFIED BY '<password>';
GRANT RELOAD, SUPER ON *.* TO 'mha'@'%' ; -- Limited admin commands to manage replication, config
GRANT SELECT ON `mysql`.* TO 'mha'@'%';
GRANT ALL PRIVILEGES ON `mysql`.`apply_diff_relay_logs` TO 'mha'@'%';
GRANT ALL PRIVILEGES ON `mysql`.`apply_diff_relay_logs_test` TO 'mha'@'%';
FLUSH PRIVILEGES;

Its possible the last 2 grants could be tightened, but I didn't experiment widely with this.