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>