mysql master+slave 部署

前提
master server ip 192.168.1.131 ubuntu
slave server ip 192.168.1.104 win2003

Master server
grant REPLICATION SLAVE on . to ‘slave_server’@’192.168.1.104’ identified by ‘12345678’;



my.conf

[mysqld]
server-id=1
bind-address = 192.168.1.131



Slave server
mysql -h 192.168.1.131 -u slave_server -p12345678 # 成功


[mysqld]
server-id=2
master-host=192.168.1.131
master-user=slave_server
master-password=12345678



重启 master / slave 的mysql服务
进入 slaver server 的 mysql
start slave;
show slave status;

完成

你可能感兴趣的:(java,mysql,ubuntu)