5月 052016
 

在CentOS 6.7下安装MySQL 5.6版本

下载并安装官方Yum源

[root@localhost ~]# yum -y install http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm

查看RPM安装包路径

[root@localhost ~]# rpm -lq mysql57-community-release-el6-8
/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
/etc/yum.repos.d/mysql-community-source.repo
/etc/yum.repos.d/mysql-community.repo
[root@localhost ~]#

查看并修改mysql-community.repo文件
启用(enable=1)需要安装的版本,禁用(enable=0)不需要的版本

[root@localhost ~]# vi /etc/yum.repos.d/mysql-community.repo
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-preview]
name=MySQL Tools Preview
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

查看仓库列表的启用及禁用状态

mysql-yum-repo-quick-guide-01

更新本地cache后查看mysql-community-server版本信息mysql-yum-repo-quick-guide-02

安装

相关引用:

MySQL Yum repository supports the following Linux Distros:

Red Hat Enterprise Linux 7 / Oracle Linux 7
Red Hat Enterprise Linux 6 / Oracle Linux 6
Red Hat Enterprise Linux 5 / Oracle Linux 5
Fedora 21, 22 and 23

MySQL Yum repository includes the latest packages:

 MySQL 5.7 (GA)
 MySQL 5.6 (GA)
 MySQL 5.5 (GA - Red Hat Enterprise Linux and Oracle Linux Only)
 MySQL Workbench
 MySQL Fabric
 MySQL Router
 MySQL Utilities
 MySQL Connector / ODBC
 MySQL Connector / Python
 MySQL Shell (preview)

下载地址
http://dev.mysql.com/downloads/repo/yum/

官方指南
http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

3月 092016
 

增加软件源

/etc/yum.repos.d/MariaDB.repo

配置文件示例如下,可根据YUM源目录中版本及系统进行修改

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

配置路径


执行安装

yum install MariaDB-server MariaDB-client

5月 182014
 

[root@AY140518164554406132Z ~]# cd /etc/yum.repos.d/
[root@AY140518164554406132Z ~]# mkdir backup
[root@AY140518164554406132Z ~]# mv *.repo backup/
[root@AY140518164554406132Z ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyuncs.com/repo/Centos-6.repo
[root@AY140518164554406132Z ~]# sed -i ‘s/aliyun.com/aliyuncs.com/’ /etc/yum.repos.d/CentOS-Base.repo
[root@AY140518164554406132Z ~]# yum clean all
[root@AY140518164554406132Z ~]# yum makecache