Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 单机主从配置
- >vim /etc/mysql/my.cnf
- [mysqld1]
- log-bin=mysql-bin
- server-id=107
- [mysqld2]
- log_bin=mysql-bin
- server_id=2
- # 主
- mysql> show master status;
- +------------------+----------+--------------+------------------+
- | File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
- +------------------+----------+--------------+------------------+
- | mysql-bin.000018 | 107 | | |
- +------------------+----------+--------------+------------------+
- 1 row in set (0.00 sec)
- # 从
- mysql> change master to master_host='192.168.10.107', master_user='slave', master_password='netposa', master_log_file='mysql-bin.000018', master_log_pos=107;
- mysql>start slave;
Add Comment
Please, Sign In to add comment