Centos配置MySQL主从数据库

本文详细介绍了如何在Centos7系统上配置MySQL主从数据库,包括安装MySQL,设置主从数据库,以及解决配置过程中的常见问题。通过步骤指导,读者将学会如何在master和slave节点间实现数据同步。
摘要由CSDN通过智能技术生成

在这之前首先确保虚拟机上安装了两个能够联网且知道IP的Centos7系统

1. 安装MySQL

1.1 安装下载

检查是否安装了mysql

rpm -qa | grep mysql

如果安装了请卸载

yum remove mysql*

因为centos-7默认是Mariadb,所以执行以下命令只是更新Mariadb数据库,这里要下载mysql的源

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

安装mysql源

rpm -ivh mysql-community-release-el7-5.noarch.rpm

安装mysql

yum install mysql-server

检查是否有错误

rpm -qa |grep mysql 

如果内容中有

Error: Package: mysql-community-libs-5.6.35-2.el7.x86_64 (mysql56-community)
           Requires: libc.so.6(GLIBC_2.17)(64bit)
Error: Package: mysql-community-server-5.6.35-2.el7.x86_64 (mysql56-community)
           Requires: libc.so.6(GLIBC_2.17)(64bit)
Error: Package: mysql-community-server-5.6.35-2.el7.x86_64 (mysql56-community)
           Requires: systemd
Error: Package: mysql-community-server-5.6.35-2.el7.x86_64 (mysql56-community)
           Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: mysql-community-client-5.6.35-2.el7.x86_64 (mysql56-community)
           Requires: libc.so.6(GLIBC_2.17)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

解决办法:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值