Linux7.6环境下安装MySQL5.7

MySQL安装

1,配置主机名,关闭防火墙及selinux

[root@DB1 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.66.63 DB1
[root@DB1 ~]# iptables -F
[root@DB1 ~]# systemctl stop firewalld
[root@DB1 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@DB1 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

Jul 07 01:30:22 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall.....
Jul 07 01:30:22 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall ...n.
Jul 07 01:31:24 DB1 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Jul 07 01:31:25 DB1 systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.
[root@DB1 ~]# setenforce 0
[root@DB1 ~]# sed -i "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config

2,配置yum源

[root@DB1 ~]# cp /etc/yum.conf /etc/yum.confbak`date +%F_%T`
[root@DB1 ~]# echo 'exclude=kernel*
> exclude=centos-release*' >> /etc/yum.conf && grep exclude /etc/yum.conf  && mkdir -p /tmp/repobak && rm -rf /tmp/repobak/* && cd /etc/yum.repos.d/ && mv -f * /tmp/repobak/ > /dev/null 2>&1
exclude=kernel*
exclude=centos-release*
[root@DB1 yum.repos.d]# curl -o /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1572  100  1572    0     0   7136      0 --:--:-- --:--:-- --:--:--  7178
[root@DB1 yum.repos.d]# mv -f /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup > /dev/null 2>&1
[root@DB1 yum.repos.d]# mv -f /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup > /dev/null 2>&1
[root@DB1 yum.repos.d]# curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   664  100   664    0     0   9644      0 --:--:-- --:--:-- --:--:--  9764
[root@DB1 yum.repos.d]# rpm --import /etc/pki/rpm-gpg/RPM* &&  yum clean all &&  yum makecache &&  yum groupinfo 'Development tools' &&  yum groupinstall -y 'Development tools' &&  yum install wget vim man rsync openssh-clients openssl -y && ls -l && cd ~

3,检查是否安装了mysql

[root@DB1 ~]# rpm -qa | grep mysql

从执行结果来看没有安装过

如果有安装过的话那就卸载执行删除命令

[root@DB1 ~]# rpm -e --nodeps 查询到的版本
#查询所有mysql对应的文件夹然后删除相关目录
[root@DB1 ~]# whereis mysql
[root@DB1 ~]</
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值