[后端开发]Mysql环境搭建 基于Centos7(记录自我学习大佬轻喷)

226 阅读1分钟

遇到的坑

  • 1.直接从官网下载的Centos7 镜像无法上网

    解决办法 vim /etc/sysconfig/network-scripts/ifcfg-ens33 然后修改ONBOOT=yes ,最后执行 service network restart ,这个时候终于可以愉快的上网了.

修改镜像源 提高yum wget的速度

备份官方镜像源文件

cd /etc/yum.repos.d

sudo mv CentOS-Base.repo CentOS-Base.repo.bak

更新官方源为阿里源

sudo wget -O CentOS-Base.repo mirrors.aliyun.com/repo/Centos…

更新epel源

wget -O /etc/yum.repos.d/epel.repo mirrors.aliyun.com/repo/epel-7…

清楚缓存

yum clean all

重新生成缓存

yum makecache

安装mysql服务

wget repo.mysql.com/mysql-commu…

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

yum update

更新速度很慢 全看运气了

yum install mysql-server

启动mysql服务

systemctl start mysqld.service