注:文中所写的安装过程均在CentOS6.5 x86下通过测试
1.检测系统是否已经安装过mysql或其依赖,若已装过要先将其删除,否则第4步使用yum安装时会报错
1 # yum list installed | grep mysql 2 mysql-libs.i686 5.1.71-1.el6 @anaconda-CentOS-201311271240.i386/6.5 3 # yum -y remove mysql-libs.i686
2.从mysql的官网下载mysql57-community-release-el6-5.noarch.rpm(注意这里要下载Red Hat Enterprise Linux 6的版本)
wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
(笔者试过mysql57-community-release-el6-8.noarch.rpm发现第4步使用yum安装时会报错,如果有知道怎么解决的同学欢迎指点)
3.安装第一步下载的rpm文件
yum install mysql-community-release-el6-5.noarch.rpm
安装成功后,我们可以看到/etc/yum.repos.d/目录下增加了以下两个文件
1 # ls /etc/yum.repo.d 2 mysql-community-source.repo 3 mysql-community.repo
查看mysql57的安装源是否可用,如不可用请自行修改配置文件(/etc/yum.repos.d/mysql-community.repo)使mysql57下面的enable=1
若有mysql其它版本的安装源可用,也请自行修改配置文件使其enable=0
1 # yum repolist enabled | grep mysql 2 mysql-connectors-community MySQL Connectors Community 13 3 mysql-tools-community MySQL Tools Community 18 4 mysql57-community-dmr MySQL 5.7 Community Server Development Milesto 65
4.使用yum安装mysql
时间: 2024-10-16 16:16:54