Home >Database >Mysql Tutorial >linux下mysql主从备份_MySQL

linux下mysql主从备份_MySQL

WBOY
WBOYOriginal
2016-06-01 13:13:091120browse

一、准备
用两台服务器做测试:
Master Server: 192.0.0.1/Linux/MYSQL 4.1.12
Slave Server: 192.0.0.2/Linux/MYSQL 4.1.18

做主从服务器的原则是,MYSQL版本要相同,如果不能满足,最起码从服务器的MYSQL的版本必须高于主服务器的MYSQL版本

二、配置master服务器
1. 登录Master服务器,编辑my.cnf
#vim /etc/my.cnf
在[mysqld]段添加以下内容:

[mysqld]
log-bin=mysql-bin
server-id=1
binlog-do-db=extmail
binlog-ignore-db=mysql,test

解释:log-bin项是让Master服务器记录二进制日志这个是必须的;
server-id=master_id 其中master_id必须为1到232

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn