MySQL官方新提供了一种安装MySQL的方法--使用YUM源安装MySQL
1、MySQL官方网站下载MySQL的YUM源,
https://dev.mysql.com/downloads/repo/yum/
在MySQL的下载页有一个“NEW!MySQL YUM Repository”,点进去找相对应的系统rpm包进行下载
如果你的Linux系统能联网,就把下载链接拷贝下:
wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm(这里是rhel6的MySQL YUM源下载地址)
2、下载完后就是一个mysql-community-release-el6-5.noarch.rpm的文件,可以用以下命令查看该文件都包含哪些包:
rpm -qpl mysql-community-release-el6-5.noarch.rpm
/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
/etc/yum.repos.d/mysql-community-source.repo
/etc/yum.repos.d/mysql-community.repo
3. 用rpm把安装,rpm -ivh mysql-community-release-el6-5.noarch.rpm
安装完上述包后,就会在yum库里生成以下几个包:
MySQL-client-5.6.16-1.el6.x86_64.rpm
MySQL-devel-5.6.16-1.el6.x86_64.rpm
MySQL-embedded-5.6.16-1.el6.x86_64.rpm
MySQL-server-5.6.16-1.el6.x86_64.rpm
MySQL-shared-5.6.16-1.el6.x86_64.rpm
MySQL-shared-compat-5.6.16-1.el6.x86_64.rpm
MySQL-test-5.6.16-1.el6.x86_64.rpm
1、MySQL官方网站下载MySQL的YUM源,
https://dev.mysql.com/downloads/repo/yum/
在MySQL的下载页有一个“NEW!MySQL YUM Repository”,点进去找相对应的系统rpm包进行下载
如果你的Linux系统能联网,就把下载链接拷贝下:
wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm(这里是rhel6的MySQL YUM源下载地址)
2、下载完后就是一个mysql-community-release-el6-5.noarch.rpm的文件,可以用以下命令查看该文件都包含哪些包:
rpm -qpl mysql-community-release-el6-5.noarch.rpm
/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
/etc/yum.repos.d/mysql-community-source.repo
/etc/yum.repos.d/mysql-community.repo
3. 用rpm把安装,rpm -ivh mysql-community-release-el6-5.noarch.rpm
安装完上述包后,就会在yum库里生成以下几个包:
MySQL-client-5.6.16-1.el6.x86_64.rpm
MySQL-devel-5.6.16-1.el6.x86_64.rpm
MySQL-embedded-5.6.16-1.el6.x86_64.rpm
MySQL-server-5.6.16-1.el6.x86_64.rpm
MySQL-shared-5.6.16-1.el6.x86_64.rpm
MySQL-shared-compat-5.6.16-1.el6.x86_64.rpm
MySQL-test-5.6.16-1.el6.x86_64.rpm
4.之后就可以用yum安装MySQL了:
yum -y install mysql-community-server
yum -y install mysql-community-server
这样做的好处在于,可以用yum管理MySQL的包,尤其是可以把MySQL的安装包生成到YUM库里,更多MYSQL的安装方式。