create user 'repl'@'%' identified with mysql_native_password by 'Abc_123456'; grant replication slave on *.* to 'repl'@'%'; flush privileges; Tips:创建好账户后,最好使用该账户在两个节点互相登录一下,以确保账户是可用的 2、修改master-01上的MySQL配置文件:
-- 监控用户 create user 'mmm_monitor'@'%' identified with mysql_native_password by 'Abc_123456'; grant replication client on *.* to 'mmm_monitor'@'%';
-- 代理用户 create user 'mmm_agent'@'%' identified with mysql_native_password by 'Abc_123456'; grant super, replication client, process on *.* to 'mmm_agent'@'%'; flush privileges; 由于配置了主从的原因,此时其他两个数据库节点也会同步这些新建的用户。在另外两个节点执行如下语句就可以查询到:
# The kill_host_bin does not exist by default, though the monitor will # throw a warning about it missing. See the section 5.10 "Kill Host # Functionality" in the PDF documentation. # # kill_host_bin /usr/libexec/mysql-mmm/monitor/kill_host # </monitor>