当前位置:网站首页>MySQL master-slave replication
MySQL master-slave replication
2022-08-03 06:33:00 【I want to learn!】
MySQL master-slave replication - create a new server:
1. You need to simulate two servers to provide two different MySQLs, and use vm to create two Linux virtual machines to create new onesThe virtual machine:
First modify the network initialization configuration to load the network card, 1.cd /etc/sysconfig/network-scripts 2.vim ifcfg-ens33 After entering, change the no at the end to yes
Second, install MySQL, use rpm to install here (yum can also be used)
Steps: upload, unzip to the specified folder, download in order - because it cannot handle dependencies by itself, Baidu finds the order (rpm needs to be in the download servicebefore installing net-tools)
Three, start MySQL, find the initial password cat /var/log/mysqld.log | grep password, then log in, and then set a new password
(need to set the password length set global validate_password_length=4;
Security levelset global validate_password_policy=LOW;
password set password=password('root');
permissions grant all on *.* to 'root'@'%' identified by 'root';
refresh flush privileges;)
MySQL master-slave replication - configuration:
1. The original server configuration mysql: enable binary log and set unique id in my.cnf
Second, the account mysql needed to create a new server> GRANT REPLICATION SLAVE ON *.* to 'xiaoming'@'%' identified by '[email protected]';
Three, new server configuration mysql:
Set a unique id in my.cnf
Bind the new server user to the privileged account provided by the original server change master to master_host='192.168.162.128',master_user='xiaoming',master_password='[email protected]',master_log_file='mysql-bin.000003',master_log_pos=441;
(The file and pos here need to be obtained from the original server)
边栏推荐
猜你喜欢

How the world's leading medical technology company maximizes design productivity | SOLIDWORKS Product Exploration

NIO知识汇总 收藏这一篇就够了!!!

TFS (Azure conversation) prohibit people checked out at the same time

Prometheus监控容器、pod、邮件告警

JSP的基本使用

Windos 内网渗透之Token的使用

3D游戏建模师在国内的真实现状,想转行,先来看看!

二分查找4 - 搜索旋转排序数组

JumpServer如何传输文件以及复制剪切板

mib browser无法接收snmp trap消息解决
随机推荐
classpath:与classpath*的比较
【面试准备】游戏开发中的几个岗位分别做什么&考察侧重点
servlet learning (7) ServletContext
使用JSP实现简单的登录注册功能,并且使用Session跟踪用户登录信息
数组与字符串11-反转字符串
BurpSuite 进阶玩法
【Personal summary】Key points of MES system development/management
DNS常见资源记录类型详解
检测微信显示无效头像图片链接
6. What is the difference between Vector, ArrayList and LinkedList?(design, performance, safety)
SSL证书过期后怎么办?
数组与字符串10-实现 strStr()
contos安装php-ffmpeg和tp5.1使用插件
g++ parameter description
什么是次世代建模,为什么这么多建模人在学习次世代建模流程
八、抽象类的接口的区别
5. What is the difference between int and Integer?
VI和VIM编辑指令
Typora
AI智能剪辑,仅需2秒一键提取精彩片段