当前位置:网站首页>MySQL configuring master-slave databases
MySQL configuring master-slave databases
2022-06-29 09:38:00 【Surname Wang Zi dizhi】
Modify the configuration file
- Master database
stay my.ini or my.conf Add... To the file
# Set up mysql Of id only
server-id = 1
# To configure mysql 2 System log
log-bin="mysql-master-bin"
Restart the database after saving
- From database
stay my.ini or my.conf Add... To the file
# Set up mysql Of id only
server-id = 2
# To configure mysql 2 System log
log-bin="mysql-master-bin"
View primary database log information
After logging into the database
show master status;

Configure from database
Connect to the main database
CHANGE MASTER TO MASTER_HOST='192.168.2.133',MASTER_PORT=3306,MASTER_USER='user',MASTER_PASSWORD='***',MASTER_LOG_FILE='binlog.0000086',MASTER_LOG_POS=12193;
#( Master database )
# MASTER_HOST ip Address
# MASTER_PORT Port number
# MASTER_USER account number
# MASTER_PASSWORD password
# MASTER_LOG_FILE Point to the log start file ( In the picture above File The value in )
# MASTER_LOG_POS Location ( Of the picture above position The value in )
Commas can be written separately 
Start the slave data function
start slave;
# stop slave; Stop slave function

View slave table status
show slave status \G;
When both values are yes When , This proves that the master-slave database configuration is successful 
Last :
If it doesn't work , Report errors :
Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
Check if there is a problem with your file name 
If there is no problem, refresh the log file in the primary database
flush logs;

Review the log 
Reconfigure from the database 
边栏推荐
- Can we trust bounding box annotations for object detection
- Closed training (25) basic web security
- 第十二章 信号(二)- 生产者消费者示例
- Understanding of singleton mode
- UE4 插件报错 Cannot open include file: ‘ModuleManager.h‘解决
- Have you done the network security "physical examination" this year?
- Pytorch summary learning series - broadcast mechanism
- The former security director of Uber faced fraud allegations and had concealed data leakage incidents
- Universal target detection based on region attention
- 云管理平台:OpenStack架构设计及详细解读
猜你喜欢

MATLAB小技巧(21)矩阵分析--偏最小二乘回归

Simplicity Studio无法识别新买的JLink v9解决方法

GD32F4xx 以太網芯片(enc28j60)驅動移植

Fabrication d'une calculatrice d'addition simple basée sur pyqt5 et Qt Designer

LSM6DSL之SPI驱动

Closed training (25) basic web security

Pytorch summary learning series - data manipulation

How to set Google Chrome as the default browser

UE4 在4.20-23版本安裝Datasmith插件

Write down some written test questions
随机推荐
watch监听和computed计算属性的使用和区别
3DMax 卡死、白屏、渲染死机问题总结
云管理平台:OpenStack架构设计及详细解读
Mysql配置主从数据库
第十二章 信号(二)- 生产者消费者示例
《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(五)
【华为认证】HCIA-DATACOM史上最全精选题库(附答案解析)
YOLACT实时实例分割
SPI drive of lsm6dsl
Training view (issue temporary storage)
pytorch总结学习系列-操作
pytoch总结—TENSOR 和NUMPY相互转换
ISO16000-9建筑产品和家具中挥发性有机物的测试
Keras to tf Vgg19 input in keras_ shape
数据处理时代,数据质量建设才是企业的生存之道
Pytoch Summary - transform between sensor and numpy
GD32F4xx 以太网芯片(enc28j60)驱动移植
Research progress of target detection in the era of deep convolutional neural network
Wechat applet opens file stream
Instance error iopub data rate exceeded