今天在安装MySql的时候,想选择linux的版本对应的MySql。
1、查看内核版本和x86/x64版本
方法一、cat /proc/version
[root@sxl129 Desktop]# cat /proc/version
Linux version 2.6.-.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4. (Red Hat 4.4.-) (GCC) ) # SMP Fri Nov :: UTC
方法二、uname -a
ktop]# uname -a
Linux sxl129 2.6.-.el6.x86_64 # SMP Fri Nov :: UTC 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。
[root@sxl129 Desktop]# lsb_release -a
bash: lsb_release: command not found
(2)、使用直接yum install -y lsb
[root@sxl129 Desktop]# yum install -y lsb
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors..com
* updates: mirrors..com
Setting up Install Process
....................................
(3)、查看linux内核版本
[root@sxl129 Desktop]# lsb_release -a
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
Distributor ID: CentOS
Description: CentOS release 6.5 (Final)
Release: 6.5
Codename: Final
至此,我们知道在选用MySql版本的时候,应该选用6.5版本&64位。
参考文档:
http://blog.****.net/xiexievv/article/details/42238835
http://www.linuxidc.com/Linux/2016-05/131749.htm
http://blog.****.net/carolzhang8406/article/details/6080400
http://www.linuxidc.com/Linux/2014-12/110748.htm