$ vi /etc/my.cnf.d/server.cnf [myslqld] log-bin=/var/log/mysql/master-bin server-id=1 #注意:日志目录需要存在 $ service mysql start $ mysql -uroot -p123456 > CREATE USER 'backup'@'%' IDENTIFIED BY '123456'; > GRANT REPLICATION SLAVE,RELOAD,SUPER ON *.* TO 'backup'@'%' IDENTIFIED BY '123456'; > FLUSH PRIVILEGES; > SHOW MASTER STATUS;