Home > php教程 > php手册 > body text

教你如何在linux下建立mysql镜像数据库

WBOY
Release: 2016-06-13 10:06:23
Original
1283 people have browsed it

MySQL 版本:4.1

环境介绍:主库 192.168.0.205 从库 192.168.0.206

1、主库创建/etc/my.cnf,修改[mysqld]里边的键值增加

server-id=1

log-bin=binlog_name

2、主库增加用户,用于从库读取主库日志。

grant replication slave,reload,super on *.* to
’slave’@’192.168.0.206’ identified by ’123456’

3、从库连接主库进行测试。

/opt/mysql/bin/mysql -u slave -p -h 192.168.0.205

4、停从库,修改从库/etc/my.cnf,增加选项:




source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template