查看CentOS/Linux的版本信息

今天在安装MySql的时候,想选择linux的版本对应的MySql。

1、查看内核版本和x86/x64版本

方法一、cat /proc/version

[root@sxl129 Desktop]# cat /proc/version
Linux version 2.6.32-431.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Fri Nov 22 03:15:09 UTC 2013

方法二、uname -a

1 ktop]# uname -a
2 Linux sxl129 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

这里显示linux的内核版本是Red Hat 4.4.7-4,64位,

 

2、查看Linux内核版本

上面显示的Red Hat 4.4.7-4是Ret Hat自己的版本号,因为它是来自于Red Hat Enterprise Linux依照开放源代码规定发布的源代码所编译而成而这还不是Linux的内核版本。

我们可以使用lsb-reales -a命令来查看Linux的内核版本。

(1)、使用lsb-reales -a命令,但是显示:bash: lsb_release: command not found。需要安装一下lsb。    

1 [root@sxl129 Desktop]# lsb_release -a
2 bash: lsb_release: command not found

(2)、使用直接yum install -y lsb

1 [root@sxl129 Desktop]# yum install -y lsb
2 Loaded plugins: fastestmirror, refresh-packagekit, security
3 Loading mirror speeds from cached hostfile
4  * base: mirrors.cn99.com
5  * extras: mirrors.163.com
6  * updates: mirrors.163.com
7 Setting up Install Process
8 ....................................

(3)、查看linux内核版本

1 [root@sxl129 Desktop]# lsb_release -a
2 LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
3 Distributor ID:    CentOS
4 Description:    CentOS release 6.5 (Final)
5 Release:    6.5
6 Codename:    Final

至此,我们知道在选用MySql版本的时候,应该选用6.5版本&64位。

 

参考文档:

http://blog.csdn.net/xiexievv/article/details/42238835

http://www.linuxidc.com/Linux/2016-05/131749.htm

http://blog.csdn.net/carolzhang8406/article/details/6080400

http://www.linuxidc.com/Linux/2014-12/110748.htm

 

posted @ 2017-12-03 09:20  gudi  阅读(4560)  评论(0编辑  收藏  举报