mysql使用yum安装最新版本
1.去官网下载mysql-community-release
下载地址:http://dev.mysql.com/downloads/repo/yum/
选择对应的版本进行下载:
我们这里使用的是centos6.5所以下载
http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
[root@sky ~]# wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
[root@sky ~]# rpm -ivh mysql-community-release-el6-5.noarch.rpm
Preparing… ########################################### [100%]
1:mysql-community-release########################################### [100%]
2.添加mysql官方yum库
[root@sky ~]# cd /etc/yum.repos.d/
[root@sky yum.repos.d]# vim mysql.repo
[mysql-community]
name=MySQL Community Server
baseurl=URL
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
根据自己的OS版本,替换适合的baseurl=URL内容:
1)对于EL6 (Centos6 / Redhat 6)
baseurl=http://repo.mysql.com/yum/mysql-community/el/6/$basearch/
2)对于Fedore 18 and 19:
baseurl=http://repo.mysql.com/yum/mysql-community/fc/$releasever/$basearch/
注意:gpgcheck=1,这表示我们需要添加GnuPG key
详情见:http://dev.mysql.com/doc/refman/ … -gpg-signature.html
设置完毕后使用以下命令安装即可:
yum install mysql-community-server
[root@sky yum.repos.d]# yum list|grep mysql
mysql-community-release.noarch el6-5 installed
mysql-libs.x86_64 5.1.61-4.el6
……………….
……….
安装完成后我们启动mysql
service mysqld start
查看mysql状态
service mysqld status
附件有完整的centos6.0的yum文件和对应的RPM-GPG-KEY-mysql文件下载完毕后分别放到/etc/yum.repo/和/etc/pki/rpm-gpg/下面即可使用。