CentOS从MySQL官方Yum仓库安装MySQL5.6(附版本查看方法)

发布于 2015-05-10  3.85k 次阅读


 

不正经的前言


这几天闲着无聊,折腾Freeradius+Openwrt+WPA2-EAP认证,本来想用Linode搭Radius认证服务器的,但是MySQL扩展怎么都安不上。(提示缺少库或冲突什么的,之前装过DA面板了)。。那算了,要是把DA面板搞坏了就不好了。。


于是用搬瓦工搭试试,各种翻资料,但是搬瓦工配置实在太不给力,Web卡成狗,开个Kodexplorer都要1分多种,想直接吧daloredius搭在Linode上,远程连接搬瓦工的数据库(我已经开始后悔了,早知道数据库放Linode,搬瓦工远程调用。。)。想用PMA改个数据库远程权限(图方便)。结果一登陆。。。



phpMyAdmin - 错误


您应升级到 MySQL 5.5.0 或更高版本。


靠。。。我不是Yum安装的吗,居然版本不是最新的?


果断 mysql -V 查看下版本:


[root@usca-1 etc]# mysql -V

mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1


整个人不好了,于是查了下,要添加MySQL官方的yum源才能获取更新版本。。


附:各种查看MySQL版本的姿势


1:在终端下:mysql -V。代码片段:


[root@usca-1 ~]# mysql -V

mysql Ver 14.14 Distrib 5.6.24, for Linux (x86_64) using EditLine wrapper


 


2:Help工具:mysql --help | grep Distrib。代码片段:


[root@usca-1 ~]# mysql --help | grep Distrib

mysql Ver 14.14 Distrib 5.6.24, for Linux (x86_64) using EditLine wrapper


 


3:RPM管理工具:rpm -qa|grep mysql。代码片段(包括其他扩展):


[root@usca-1 ~]# rpm -qa|grep mysql

mysql-community-libs-5.6.24-3.el6.x86_64

mysql-community-libs-compat-5.6.24-3.el6.x86_64

php-mysql-5.3.3-40.el6_6.x86_64

freeradius-mysql-2.1.12-6.el6.x86_64

mysql-community-release-el6-5.noarch

mysql-community-common-5.6.24-3.el6.x86_64

mysql-community-client-5.6.24-3.el6.x86_64

mysql-community-server-5.6.24-3.el6.x86_64


关于什么新特性(Xiao),什么支持,不做讨论,先入重点:

访问:http://dev.mysql.com/downloads/repo/

可以看到 MySQL Yum Repository→Download 点进去。

按照你的系统版本选择需要的RPM包:

如CentOS6.5选择:

Red Hat Enterprise Linux 6 / Oracle Linux 6 (Architecture Independent), RPM Package 5.7K
(mysql-community-release-el6-5.noarch.rpm) MD5: 1cbcf6b4ae7592b9ac100d9e7cd2ceb4

点击Download,然后会打开一个页面,两个大按钮,一个Login,一个Sign Up。然后我就被骗了,傻傻的注册了半天。

镜头移下去,会看到No thanks, just start my download.

直接下载即可。Wget Friendly测试√。

在终端下(上方蓝色下载连接及以下针对CentOS6.5,请按情况更改!):

wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

sudo yum localinstall mysql-community-release-el6-*.noarch.rpm

sudo yum install mysql-community-server

安装成功,Easy。

 

 

符:安装代码片段


附录:安装代码片段(仅参考,换行会变成空格!):


PS:我顺便把之前的MySQL卸了。


[root@usca-1 ~]# wget http://dev.mysql.com/get/mysql-community-release-el6-5.noa rch.rpm

--2015-05-10 14:11:52-- http://dev.mysql.com/get/mysql-community-release-el6-5. noarch.rpm

Resolving dev.mysql.com... 137.254.60.11

Connecting to dev.mysql.com|137.254.60.11|:80... connected.

HTTP request sent, awaiting response... 302 Found

Location: http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm [follow ing]

--2015-05-10 14:11:52-- http://repo.mysql.com/mysql-community-release-el6-5.noa rch.rpm

Resolving repo.mysql.com... 23.213.105.122

Connecting to repo.mysql.com|23.213.105.122|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 5824 (5.7K) [application/x-redhat-package-manager]

Saving to: `mysql-community-release-el6-5.noarch.rpm'


100%[======================================>] 5,824 --.-K/s in 0s


2015-05-10 14:11:52 (412 MB/s) - `mysql-community-release-el6-5.noarch.rpm' save d [5824/5824]


[root@usca-1 ~]# yum localinstall mysql-community-release-el6-*.noarch.rpm

Loaded plugins: fastestmirror

Setting up Local Package Process

Examining mysql-community-release-el6-5.noarch.rpm: mysql-community-release-el6- 5.noarch

Marking mysql-community-release-el6-5.noarch.rpm to be installed

Loading mirror speeds from cached hostfile

* base: mirror.chpc.utah.edu

* extras: mirrors.easynews.com

* rpmforge: mirror.hmc.edu

* updates: repos.lax.quadranet.com

Resolving Dependencies

--> Running transaction check

---> Package mysql-community-release.noarch 0:el6-5 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


================================================================================

Package Arch Version

Repository Size

================================================================================

Installing:

mysql-community-release

noarch el6-5 /mysql-community-release-el6-5.noarch 4.3 k


Transaction Summary

================================================================================

Install 1 Package(s)


Total size: 4.3 k

Installed size: 4.3 k

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : mysql-community-release-el6-5.noarch 1/1

Verifying : mysql-community-release-el6-5.noarch 1/1


Installed:

mysql-community-release.noarch 0:el6-5


Complete!

[root@usca-1 ~]# yum install mysql-community-server

Loaded plugins: fastestmirror

Setting up Install Process

Loading mirror speeds from cached hostfile

* base: mirror.chpc.utah.edu

* extras: mirrors.easynews.com

* rpmforge: mirror.hmc.edu

* updates: repos.lax.quadranet.com

mysql-connectors-community | 2.5 kB 00:00

mysql-connectors-community/primary_db | 7.3 kB 00:00

mysql-tools-community | 2.5 kB 00:00

mysql-tools-community/primary_db | 22 kB 00:00

mysql56-community | 2.5 kB 00:00

mysql56-community/primary_db | 88 kB 00:00

Resolving Dependencies

--> Running transaction check

---> Package mysql-community-server.x86_64 0:5.6.24-3.el6 will be obsoleting

--> Processing Dependency: mysql-community-common(x86-64) = 5.6.24-3.el6 for pac kage: mysql-community-server-5.6.24-3.el6.x86_64

--> Processing Dependency: mysql-community-client(x86-64) = 5.6.24-3.el6 for pac kage: mysql-community-server-5.6.24-3.el6.x86_64

--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: mysql-com munity-server-5.6.24-3.el6.x86_64

--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: mysql-com munity-server-5.6.24-3.el6.x86_64

--> Processing Dependency: libaio.so.1()(64bit) for package: mysql-community-ser ver-5.6.24-3.el6.x86_64

---> Package mysql-server.x86_64 0:5.1.73-3.el6_5 will be obsoleted

--> Running transaction check

---> Package libaio.x86_64 0:0.3.107-10.el6 will be installed

---> Package mysql.x86_64 0:5.1.73-3.el6_5 will be obsoleted

--> Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-devel-5.1.7 3-3.el6_5.x86_64

---> Package mysql-community-client.x86_64 0:5.6.24-3.el6 will be obsoleting

--> Processing Dependency: mysql-community-libs(x86-64) = 5.6.24-3.el6 for packa ge: mysql-community-client-5.6.24-3.el6.x86_64

---> Package mysql-community-common.x86_64 0:5.6.24-3.el6 will be installed

--> Running transaction check

---> Package mysql-community-devel.x86_64 0:5.6.24-3.el6 will be obsoleting

---> Package mysql-community-libs.x86_64 0:5.6.24-3.el6 will be obsoleting

---> Package mysql-devel.x86_64 0:5.1.73-3.el6_5 will be obsoleted

---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be obsoleted

--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: php-mysql- 5.3.3-40.el6_6.x86_64

--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-M ySQL-4.013-3.el6.x86_64

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for pa ckage: php-mysql-5.3.3-40.el6_6.x86_64

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for pa ckage: perl-DBD-MySQL-4.013-3.el6.x86_64

--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: freeradi us-mysql-2.1.12-6.el6.x86_64

--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: freeradius-mysql-2.1.12-6.el6.x86_64

--> Running transaction check

---> Package mysql-community-libs-compat.x86_64 0:5.6.24-3.el6 will be obsoletin g

--> Finished Dependency Resolution


Dependencies Resolved


================================================================================

Package Arch Version Repository Size

================================================================================

Installing:

mysql-community-client x86_64 5.6.24-3.el6 mysql56-community 18 M

replacing mysql.x86_64 5.1.73-3.el6_5

mysql-community-devel x86_64 5.6.24-3.el6 mysql56-community 3.2 M

replacing mysql-devel.x86_64 5.1.73-3.el6_5

mysql-community-libs x86_64 5.6.24-3.el6 mysql56-community 1.9 M

replacing mysql-libs.x86_64 5.1.73-3.el6_5

mysql-community-libs-compat x86_64 5.6.24-3.el6 mysql56-community 1.6 M

replacing mysql-libs.x86_64 5.1.73-3.el6_5

mysql-community-server x86_64 5.6.24-3.el6 mysql56-community 53 M

replacing mysql-server.x86_64 5.1.73-3.el6_5

Installing for dependencies:

libaio x86_64 0.3.107-10.el6 base 21 k

mysql-community-common x86_64 5.6.24-3.el6 mysql56-community 307 k


Transaction Summary

================================================================================

Install 7 Package(s)


Total download size: 78 M

Is this ok [y/N]: ^CExiting on user Command

[root@usca-1 ~]# yum remove mysql*

Loaded plugins: fastestmirror

Setting up Remove Process

No Match for argument: mysql-community-release-el6-5.noarch.rpm

Loading mirror speeds from cached hostfile

* base: mirror.chpc.utah.edu

* extras: mirror.tocici.com

* rpmforge: mirror.hmc.edu

* updates: repos.lax.quadranet.com

No Packages marked for removal

[root@usca-1 ~]# yum remove mysql

Loaded plugins: fastestmirror

Setting up Remove Process

Resolving Dependencies

--> Running transaction check

---> Package mysql.x86_64 0:5.1.73-3.el6_5 will be erased

--> Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-server-5.1. 73-3.el6_5.x86_64

--> Processing Dependency: mysql = 5.1.73-3.el6_5 for package: mysql-devel-5.1.7 3-3.el6_5.x86_64

--> Running transaction check

---> Package mysql-devel.x86_64 0:5.1.73-3.el6_5 will be erased

---> Package mysql-server.x86_64 0:5.1.73-3.el6_5 will be erased

--> Finished Dependency Resolution


Dependencies Resolved


================================================================================

Package Arch Version Repository Size

================================================================================

Removing:

mysql x86_64 5.1.73-3.el6_5 @base 2.4 M

Removing for dependencies:

mysql-devel x86_64 5.1.73-3.el6_5 @base 388 k

mysql-server x86_64 5.1.73-3.el6_5 @base 25 M


Transaction Summary

================================================================================

Remove 3 Package(s)


Installed size: 27 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Erasing : mysql-devel-5.1.73-3.el6_5.x86_64 1/3

Erasing : mysql-server-5.1.73-3.el6_5.x86_64 2/3

warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave

Erasing : mysql-5.1.73-3.el6_5.x86_64 3/3

Verifying : mysql-devel-5.1.73-3.el6_5.x86_64 1/3

Verifying : mysql-server-5.1.73-3.el6_5.x86_64 2/3

Verifying : mysql-5.1.73-3.el6_5.x86_64 3/3


Removed:

mysql.x86_64 0:5.1.73-3.el6_5


Dependency Removed:

mysql-devel.x86_64 0:5.1.73-3.el6_5 mysql-server.x86_64 0:5.1.73-3.el6_5


Complete!

[root@usca-1 ~]# yum install mysql-community-server

Loaded plugins: fastestmirror

Setting up Install Process

Loading mirror speeds from cached hostfile

* base: mirror.chpc.utah.edu

* extras: mirror.tocici.com

* rpmforge: mirror.hmc.edu

* updates: repos.lax.quadranet.com

Resolving Dependencies

--> Running transaction check

---> Package mysql-community-server.x86_64 0:5.6.24-3.el6 will be installed

--> Processing Dependency: mysql-community-common(x86-64) = 5.6.24-3.el6 for pac kage: mysql-community-server-5.6.24-3.el6.x86_64

--> Processing Dependency: mysql-community-client(x86-64) = 5.6.24-3.el6 for pac kage: mysql-community-server-5.6.24-3.el6.x86_64

--> Processing Dependency: libaio.so.1(LIBAIO_0.4)(64bit) for package: mysql-com munity-server-5.6.24-3.el6.x86_64

--> Processing Dependency: libaio.so.1(LIBAIO_0.1)(64bit) for package: mysql-com munity-server-5.6.24-3.el6.x86_64

--> Processing Dependency: libaio.so.1()(64bit) for package: mysql-community-ser ver-5.6.24-3.el6.x86_64

--> Running transaction check

---> Package libaio.x86_64 0:0.3.107-10.el6 will be installed

---> Package mysql-community-client.x86_64 0:5.6.24-3.el6 will be installed

--> Processing Dependency: mysql-community-libs(x86-64) = 5.6.24-3.el6 for packa ge: mysql-community-client-5.6.24-3.el6.x86_64

---> Package mysql-community-common.x86_64 0:5.6.24-3.el6 will be installed

--> Running transaction check

---> Package mysql-community-libs.x86_64 0:5.6.24-3.el6 will be obsoleting

---> Package mysql-libs.x86_64 0:5.1.73-3.el6_5 will be obsoleted

--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: php-mysql- 5.3.3-40.el6_6.x86_64

--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-M ySQL-4.013-3.el6.x86_64

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for pa ckage: php-mysql-5.3.3-40.el6_6.x86_64

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for pa ckage: perl-DBD-MySQL-4.013-3.el6.x86_64

--> Processing Dependency: libmysqlclient_r.so.16()(64bit) for package: freeradi us-mysql-2.1.12-6.el6.x86_64

--> Processing Dependency: libmysqlclient_r.so.16(libmysqlclient_16)(64bit) for package: freeradius-mysql-2.1.12-6.el6.x86_64

--> Running transaction check

---> Package mysql-community-libs-compat.x86_64 0:5.6.24-3.el6 will be obsoletin g

--> Finished Dependency Resolution


Dependencies Resolved


================================================================================

Package Arch Version Repository Size

================================================================================

Installing:

mysql-community-libs x86_64 5.6.24-3.el6 mysql56-community 1.9 M

replacing mysql-libs.x86_64 5.1.73-3.el6_5

mysql-community-libs-compat x86_64 5.6.24-3.el6 mysql56-community 1.6 M

replacing mysql-libs.x86_64 5.1.73-3.el6_5

mysql-community-server x86_64 5.6.24-3.el6 mysql56-community 53 M

Installing for dependencies:

libaio x86_64 0.3.107-10.el6 base 21 k

mysql-community-client x86_64 5.6.24-3.el6 mysql56-community 18 M

mysql-community-common x86_64 5.6.24-3.el6 mysql56-community 307 k


Transaction Summary

================================================================================

Install 6 Package(s)


Total download size: 74 M

Is this ok [y/N]: y

Downloading Packages:

(1/6): libaio-0.3.107-10.el6.x86_64.rpm | 21 kB 00:00

(2/6): mysql-community-client-5.6.24-3.el6.x86_64.rpm | 18 MB 00:00

(3/6): mysql-community-common-5.6.24-3.el6.x86_64.rpm | 307 kB 00:00

(4/6): mysql-community-libs-5.6.24-3.el6.x86_64.rpm | 1.9 MB 00:00

(5/6): mysql-community-libs-compat-5.6.24-3.el6.x86_64.r | 1.6 MB 00:00

(6/6): mysql-community-server-5.6.24-3.el6.x86_64.rpm | 53 MB 00:01

--------------------------------------------------------------------------------

Total 25 MB/s | 74 MB 00:02

warning: rpmts_HdrFromFdno: 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 <mysql-build@oss.oracle.com>

Package: mysql-community-release-el6-5.noarch (@/mysql-community-release-el6-5. noarch)

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

Installing : mysql-community-common-5.6.24-3.el6.x86_64 1/7

Installing : mysql-community-libs-5.6.24-3.el6.x86_64 2/7

Installing : mysql-community-client-5.6.24-3.el6.x86_64 3/7

Installing : libaio-0.3.107-10.el6.x86_64 4/7

Installing : mysql-community-server-5.6.24-3.el6.x86_64 5/7

Installing : mysql-community-libs-compat-5.6.24-3.el6.x86_64 6/7

Erasing : mysql-libs-5.1.73-3.el6_5.x86_64 7/7

Verifying : libaio-0.3.107-10.el6.x86_64 1/7

Verifying : mysql-community-libs-compat-5.6.24-3.el6.x86_64 2/7

Verifying : mysql-community-libs-5.6.24-3.el6.x86_64 3/7

Verifying : mysql-community-common-5.6.24-3.el6.x86_64 4/7

Verifying : mysql-community-client-5.6.24-3.el6.x86_64 5/7

Verifying : mysql-community-server-5.6.24-3.el6.x86_64 6/7

Verifying : mysql-libs-5.1.73-3.el6_5.x86_64 7/7


Installed:

mysql-community-libs.x86_64 0:5.6.24-3.el6

mysql-community-libs-compat.x86_64 0:5.6.24-3.el6

mysql-community-server.x86_64 0:5.6.24-3.el6


Dependency Installed:

libaio.x86_64 0:0.3.107-10.el6

mysql-community-client.x86_64 0:5.6.24-3.el6

mysql-community-common.x86_64 0:5.6.24-3.el6


Replaced:

mysql-libs.x86_64 0:5.1.73-3.el6_5


Complete!



升空的焰火,从下面看还是从侧面看?