当前位置:网站首页>MySQL master-slave synchronization
MySQL master-slave synchronization
2022-06-30 20:08:00 【Study hard and love you hard!】
mysql install You need to install two
https://blog.csdn.net/weixin_45247019/article/details/124748512
Main library configuration
cd /mydata/mysql/conf
# Modify file
vi my.cnf
my.cnf
[mysqld]
# Open the binary log and specify the log name prefix
log-bin=mysql-bin
# Set unique library ID
server-id=1
Restart the service
service mysql restart
Add users ( Use from primary connection )
# Sign in mysql
mysql -u root -p
# Create user repl
mysql> CREATE USER 'replymeee'@'%' IDENTIFIED WITH mysql_native_password BY 'replymeee';
# Grant users repl From library related permissions
mysql> GRANT REPLICATION SLAVE ON *.* TO 'replymeee'@'%';
# Refresh the permissions
mysql> flush privileges;
Get the master library Log file and location
mysql> SHOW MASTER STATUS;

Configuration from library
cd /mydata/mysql/conf
# Modify file
vi my.cnf
my.cnf
[mysqld]
# Open the binary log and specify the log name prefix
log-bin=mysql-bin
# Set unique library ID
server-id=2
Restart the service
service mysql restart
Connect the main library
# Sign in mysql
mysql -u root -p
# Set main library parameters
mysql> CHANGE MASTER TO
MASTER_HOST='xxx.xxx.xxx.xxx', # Main library ip
MASTER_USER='replymeee', # user
MASTER_PASSWORD='replymeee', # password
MASTER_LOG_FILE='binlog.000006', # Binary
MASTER_LOG_POS=856; # Binary position
Turn on synchronization
start slave;
# Check the status
show slave status\G;

Author's statement
If there is a problem , Welcome to correct !
边栏推荐
- 开会,OneMeeting,OK!
- RP prototype resource sharing - shopping app
- Warmup预热学习率「建议收藏」
- 如何做好测试用例设计
- 【ICCV 2019】特征超分检测:Towards Precise Supervision of Feature Super-Resolution for Small Object Detection
- 解决arm_release_ver of this libmali is ‘g2p0-01eac0‘,rk_so_ver is ‘4‘,libgl1-mesa-dev不会被安装,存在未满足的依赖关系
- CV+Deep Learning——网络架构Pytorch复现系列——basenets(BackBones)(一)
- Buttons to achieve various effects and functions. Reading this article is enough
- c语言数组截取,C# 字符串按数组截取方法(C/S)
- 【NLP】【TextCNN】 文本分类
猜你喜欢

2022年高考都结束了,还有人真觉得程序员下班后不需要学习吗?

闲鱼难“翻身”

History, selection strategy and in-depth evaluation of note taking software

标配10个安全气囊,奇瑞艾瑞泽8安全防护无死角

网易云签到可抽奖?那一年我能签到365天。不信?你看。

Taiwan SSS Xinchuang sss1700 replaces cmedia cm6533 24bit 96KHz USB audio codec chip

FH6908A负极关断同步整流模拟低压降二极管控制IC芯片TSOT23-6超低功耗整流器 1w功耗 <100uA静态 替代MP6908

如何快速通过PMP考试?

KubeVela 1.4:让应用交付更安全、上手更简单、过程更透明

Transport layer uses sliding window to realize flow control
随机推荐
Unity 如何拖拉多个组件中的一个
Warmup预热学习率「建议收藏」
建立自己的网站(20)
RP原型资源分享-购物类App
DNS服务器搭建、转发、主从配置
4.3寸触控屏12路控制端口可编程网络中控支持5台中控主机相互备份
Graduates
【ICCV 2019】特征超分检测:Towards Precise Supervision of Feature Super-Resolution for Small Object Detection
Playwright - 滚动条操作
Growth summer challenge is coming, exclusive community welfare is coming ~ get CSDN customized T-shirt for free
Conditional compilation
VR云展厅如何给线下实体带来活力?有哪些功能?
启动PHP报错ERROR: [pool www] cannot get uid for user ‘@[email protected]’
SM2246EN+闪迪15131
为什么一定要从DevOps走向BizDevOps?
正则系列之字符类
条件编译
Solution to rollback of MySQL database by mistake deletion
Filebeat自定义index和fields
将秒数转换为**小时**分钟