2013年10月,MySQL开发团队正式宣布支持Yum仓库,这就意味着我们现在可以从这个Yum库中获得最新和最优版的MySQL安装包。本文将在一台全新安装的CentOS6上安装MySQL5.6,如果你不熟悉MySQL5.6的新特性,我建议从MySQL 5.6的新特性开始,其中有很多非常有用的特性。
首先我们需要从MySQL开发者网站下载Yum仓库文件,导入Yum库后,一个简单的yumupdate命令将确保你运行在MySQL5.6的最新发布版 上,包括一些安全特性的更新。Yum同时也将确保导入相关依赖库,这些都将使我们的安装过程简单化。进入http://dev.mysql.com/downloads/repo/,下载RedHat Enterprise Linux 6 / Oracle Linux 6版。
下载完成后将Yum库导入到你的本地:
# mkdir /tmp/soft/ # mv /home/gao/download/mysql-community-release-el6-5.noarch.rpm /tmp/soft/
# yum localinstall mysql-community-release-el6-5.noarch.rpm
或者
# rpm -ivh mysql-community-release-el6-5.noarch.rpm
或者
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
这个Yum库包含了MySQLServer,MySQL工作台管理工具以及ODBC驱动,现在可以通过下面的命令简单地安装MySQLServer:
# yum install mysql-community-server
至此我就可以使用Yum简单地管理MySQL更新,并能确保总是从官网软件库得到最新的发布版
参考网址:
http://www.ttlsa.com/mysql/a-quick-guide-to-using-the-mysql-yum-repository/
http://blog.csdn.net/iefreer/article/details/38366575
[root@centOS-i386-mini soft]# rpm -ivh mysql-community-release-el6-5.noarch.rpm Preparing... ########################################### [100%]
1:mysql-community-release########################################### [100%]
[root@centOS-i386-mini soft]# ll
总用量 8
-rw-r--r--. 1 root root 5824 11月 13 22:37 mysql-community-release-el6-5.noarch.rpm
[root@centOS-i386-mini soft]# yum install mysql-community-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* PUIAS_6_computational: puias.math.ias.edu
* base: mirrors.163.com
* epel: mirrors.opencas.cn
* extras: mirrors.btte.net
* updates: mirror.neu.edu.cn
mysql-connectors-community | 2.5 kB 00:00
mysql-connectors-community/primary_db | 8.8 kB 00:00
mysql-tools-community | 2.5 kB 00:01
mysql-tools-community/primary_db | 18 kB 00:00
mysql56-community | 2.5 kB 00:00
mysql56-community/primary_db | 82 kB 00:03
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.i686 0:5.6.27-2.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-32) = 5.6.27-2.el6 for package: mysql-community-server-5.6.27-2.el6.i686
--> Processing Dependency: mysql-community-client(x86-32) = 5.6.27-2.el6 for package: mysql-community-server-5.6.27-2.el6.i686
--> Processing Dependency: libnuma.so.1(libnuma_1.2) for package: mysql-community-server-5.6.27-2.el6.i686
--> Processing Dependency: libnuma.so.1(libnuma_1.1) for package: mysql-community-server-5.6.27-2.el6.i686
--> Processing Dependency: libnuma.so.1 for package: mysql-community-server-5.6.27-2.el6.i686
--> Running transaction check
---> Package mysql-community-client.i686 0:5.6.27-2.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-32) = 5.6.27-2.el6 for package: mysql-community-client-5.6.27-2.el6.i686
---> Package mysql-community-common.i686 0:5.6.27-2.el6 will be installed
---> Package numactl.i686 0:2.0.9-2.el6 will be installed
--> Running transaction check
---> Package mysql-community-libs.i686 0:5.6.27-2.el6 will be obsoleting
---> Package mysql-libs.i686 0:5.1.73-3.el6_5 will be obsoleted
--> Processing Dependency: libmysqlclient.so.16 for package: perl-DBD-MySQL-4.013-3.el6.i686
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16) for package: perl-DBD-MySQL-4.013-3.el6.i686
--> Running transaction check
---> Package mysql-community-libs-compat.i686 0:5.6.27-2.el6 will be obsoleting
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql-community-libs i686 5.6.27-2.el6 mysql56-community 1.8 M
replacing mysql-libs.i686 5.1.73-3.el6_5
mysql-community-libs-compat i686 5.6.27-2.el6 mysql56-community 1.6 M
replacing mysql-libs.i686 5.1.73-3.el6_5
mysql-community-server i686 5.6.27-2.el6 mysql56-community 52 M
Installing for dependencies:
mysql-community-client i686 5.6.27-2.el6 mysql56-community 17 M
mysql-community-common i686 5.6.27-2.el6 mysql56-community 307 k
numactl i686 2.0.9-2.el6 base 69 k
Transaction Summary
================================================================================
Install 6 Package(s)
Total download size: 73 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): mysql-community-client-5.6.27-2.el6.i686.rpm | 17 MB 19:38
(2/6): mysql-community-common-5.6.27-2.el6.i686.rpm | 307 kB 00:14
(3/6): mysql-community-libs-5.6.27-2.el6.i686.rpm | 1.8 MB 01:51
(4/6): mysql-community-libs-compat-5.6.27-2.el6.i686.rpm | 1.6 MB 02:14
(5/6): mysql-community-server-5.6.27-2.el6.i686.rpm | 52 MB 48:49
(6/6): numactl-2.0.9-2.el6.i686.rpm | 69 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 17 kB/s | 73 MB 72:57
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : MySQL Release Engineering <[email protected]>
Package: mysql-community-release-el6-5.noarch (installed)
From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.6.27-2.el6.i686 1/7
Installing : mysql-community-libs-5.6.27-2.el6.i686 2/7
Installing : mysql-community-client-5.6.27-2.el6.i686 3/7
Installing : numactl-2.0.9-2.el6.i686 4/7
Installing : mysql-community-server-5.6.27-2.el6.i686 5/7
Installing : mysql-community-libs-compat-5.6.27-2.el6.i686 6/7
Erasing : mysql-libs-5.1.73-3.el6_5.i686 7/7
Verifying : mysql-community-libs-compat-5.6.27-2.el6.i686 1/7
Verifying : mysql-community-common-5.6.27-2.el6.i686 2/7
Verifying : mysql-community-server-5.6.27-2.el6.i686 3/7
Verifying : mysql-community-libs-5.6.27-2.el6.i686 4/7
Verifying : numactl-2.0.9-2.el6.i686 5/7
Verifying : mysql-community-client-5.6.27-2.el6.i686 6/7
Verifying : mysql-libs-5.1.73-3.el6_5.i686 7/7
Installed:
mysql-community-libs.i686 0:5.6.27-2.el6 mysql-community-libs-compat.i686 0:5.6.27-2.el6 mysql-community-server.i686 0:5.6.27-2.el6
Dependency Installed:
mysql-community-client.i686 0:5.6.27-2.el6 mysql-community-common.i686 0:5.6.27-2.el6 numactl.i686 0:2.0.9-2.el6
Replaced:
mysql-libs.i686 0:5.1.73-3.el6_5
Complete!
[root@centOS-i386-mini soft]#