Centos7安装mysql

来源:互联网 发布:淘宝举证是什么意思 编辑:程序博客网 时间:2024/06/06 16:47
首先是,现在的Centos7已经将mysql从默认的程序列表中移除了,取而代之的是一个mariadb的分支版本,可是有强迫症的我非要装一个mysql,于是找到了一个方法(参考了国外某人的过程)
这个的源也是一个社区资料库
步骤(root权限):
注意下面的el7 是字母l,不是数字1

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmrpm -ivh mysql-community-release-el7-5.noarch.rpmyum update


然后安装与启动

yum install mysql-serversystemctl start mysqld.service

关于这个启动,我看好多帖子上写着是 systemctl start mysqld 或者是 service mysqld start
但是这两个都会提示 failed * unit not found,然后在某个帖子中看到了这个命令
尝试之,成功,至于为什么我也不知道。
然后允许开机自动运行也变成了 systemctl enable mysqld.service
原创粉丝点击