Home > Backend Development > PHP Tutorial > Teach you how to build a mysql mirror database under linux_PHP tutorial

Teach you how to build a mysql mirror database under linux_PHP tutorial

WBOY
Release: 2016-07-13 17:02:59
Original
915 people have browsed it

MySQL Version: 4.1

Environment introduction: main library 192.168.0.205 slave library 192.168.0.206

1. Main library creation/ etc/my.cnf, modify the key value in [mysqld] and add

server-id=1

log-bin=binlog_name

2. Add users to the main database, Used to read the main library log from the library.

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

3. Connect the slave library to the main library for testing .

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

4. Stop the slave library, modify the slave library/etc/my.cnf, and add options:




www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631009.htmlTechArticleMySQL version: 4.1 Environment introduction: main library 192.168.0.205 slave library 192.168.0.206 1. Create the main library /etc /my.cnf, modify the key value in [mysqld] and add server-id=1 log-bin=binlog_name 2. Main library...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template