当前位置:网站首页>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)
边栏推荐
猜你喜欢
随机推荐
Podman can learn in one piece
@JsonProperty和JSONField的区别?
2021-06-14
TFS(Azure DevOps)禁止多人同时签出
What is parametric design, let's understand it through practical operation?| SOLIDWORKS How-To Videos
详解SSL证书的分类以及如何选择合适的证书?
【3D建模制作技巧分享】ZBrush快捷键如何设置
新手学习3DMAX游戏建模,该如何锻炼思维?请看下面
使用Contab调用Shell脚本执行expdp自动备份Oracle
5. What is the difference between int and Integer?
数组与字符串11-反转字符串
JS--正则表达式
在Maya和ZBrush中制作战士模型
六、对比Vector、ArrayList、LinkedList有何区别?(设计、性能、安全)
g++ parameter description
Oracle 11g静默安装
mib browser无法接收snmp trap消息解决
servlet学习(七)ServletContext
嘿!selenium自动下载driver版本,得知道一下
2021-06-20









