主库:192.168.1.250

从库:192.168.1.199

主库  my.ini

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL. [mysqld] # Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin # These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = ..... # Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M # 以下内容手动添加
[client]
default-character-set=utf8
[mysqld]
port=3306
server-id=1
log-bin=mysql-bin
binlog-do-db=kintech_pd
sync_binlog=1 basedir=C:\ProgramData\MySQL\MySQL Server 5.7
#解压目录下data目录
datadir=C:\ProgramData\MySQL\MySQL Server 5.7\data
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[WinMySQLAdmin]
C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe

从库 my.ini

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL. [mysqld] # Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin # These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = ..... # Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M # 以下内容手动添加
[client]
default-character-set=utf8
[mysqld]
#从库配置
server_id=2
#如果库名相同,使用这个
#replicate-do-db=kintech_pd
#如果库名不同,使用这个。
replicate-rewrite-db = kintech_pd -> kps_common #端口
port=3306
character_set_server=utf8
#解压目录
basedir=C:\ProgramData\MySQL\MySQL Server 5.7
#解压目录下data目录
datadir=C:\ProgramData\MySQL\MySQL Server 5.7\data sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[WinMySQLAdmin]
C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe

主库:记住 File 和 Position


CREATE USER 'slave'@'MySql2服务器ip' IDENTIFIED BY '密码';
GRANT REPLICATION SLAVE ON *.* TO 'slave'@'MySql2服务器ip'; flush privileges; show master status;

从库:


CHANGE MASTER TO
master_host = 'MySql1服务器ip',
master_user = 'slave',
master_password = '密码',
master_log_file = 'bin_log.000002',
master_log_pos = 631; start slave; show slave status\G

最后显示:

代表成功。

最新文章

  1. Python中用format函数格式化字符串的用法
  2. mysql 显示行号,以及分组排序
  3. STL--stack
  4. Sql Server Text 类型列 查询和更新
  5. windows 7文件共享方法
  6. Task schedule
  7. ubuntu 下源码安装Postgreql pgAdmin3
  8. Spring中获取对象
  9. SVM原理以及Tensorflow 实现SVM分类(附代码)
  10. if语句2017-03-17
  11. STL:list用法详解
  12. 007_zkCli.sh
  13. Python pyc知识了解
  14. solr6.4.2之webservice兼容升级
  15. 学习Shell(一)
  16. [Ynoi2016]这是我自己的发明(莫队)
  17. RedHat 6.4 安装WAS 7.0 启动失败com.ibm.websphere.ssl.SSLException
  18. 前端代码在线调试&分享网站
  19. ini 文件操作记要(2): 使用 TMemIniFile
  20. cocos进阶教程(3)Lua加密技术

热门文章

  1. Dapper简易教程(翻译自Github上StackExchange/Dapper)
  2. Python-os模块-60
  3. 【RSYSLOG】The Property Replacer【转】
  4. AtCoder Beginner Contest 049 & ARC065 連結 / Connectivity AtCoder - 2159 (并查集)
  5. Kernel Functions-Introduction to SVM Kernel & Examples - DataFlair
  6. Tomcat集成Memcached Session Manager方案
  7. Zabbix appliance One Stop
  8. 手机浏览器 - 如何消除<a>标签在点击时的蓝色底色?
  9. Java——scoket通讯
  10. python爬虫之Anaconda安装