当前位置:网站首页>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 
边栏推荐
- GD32F4xx 以太网芯片(enc28j60)驱动移植
- easyexecl导出100万行execl报字体错误的解决办法
- Pytorch learning summary - memory cost of operation
- Yolo nano: a highly compact one look convolutional neural network for target detection
- 深卷积神经网络时代的目标检测研究进展
- Detecting and counting tiny faces
- Easyexcl export 1million lines of EXECL report font error solution
- Data visualization: the four quadrants of data visualization teach you to correctly apply icons
- c语言printf大家族系列
- How to implement observer mode
猜你喜欢

数据处理时代,数据质量建设才是企业的生存之道

UE4 去掉材质中Mask透明白边

Reading notes on how to connect the network - Web server request and response (IV)

Remember to customize the top navigation bar of wechat applet

Gd32f4xx Ethernet chip (ENC28J60) driver migration

UE4 材质UV纹理不随模型缩放拉伸

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

Wechat applet wx Navigateback returns the parameters carried on the previous page

Closed training (25) basic web security

MATLAB小技巧(21)矩阵分析--偏最小二乘回归
随机推荐
pytorch学习总结—运算的内存开销
Universal target detection based on region attention
Chapter 12 signals (II) - examples of producers and consumers
After aikuai is installed or reset, the PC or mobile terminal cannot obtain IP
股票炒股账号开户安全吗?是靠谱的吗?
UE4 在4.20-23版本安裝Datasmith插件
YOLACT实时实例分割
Yotact real-time instance segmentation
How to implement observer mode
数据治理:数据标准管理(第三篇)
Find the most repeated element in the string
Wechat applet search keyword highlighting and ctrl+f search positioning
云管理平台:OpenStack架构设计及详细解读
Closed training (25) basic web security
UE4 去掉材质中Mask透明白边
数据可视化:数据可视化四象限,教你正确应用图标
LeetCode刷题——泰波那契数列
LSM6DSL之SPI驱动
Mh/t 6040 smoke density test of aviation materials
Pat (basic level) practice (Chinese) 1003 I want to pass! (20 points) C language implementation