1.查看OS版本,即便系统不是CentOS或许不是6.9版本能够透过百度查寻相应版本的设置情势

问题:通过lsb_release -a 是查看linux系统版本时报错,具体的消除办法如下:

 

以下操作在centos系统上落实,有些措施也许只适用centos/redhat版本系统

#lsb_release -a 

[root@localhost ~]# lsb_release -a
-bash: lsb_release: command not found

[root@hadoop2 etc]# cat issue
CentOS release 6.8 (Final)
Kernel \Linux系统查看系统版本命令,解决措施。r on an \m

  1. uname -a |uname -r查看内核版本音讯
    “`linux
    [root@node1 ~]# uname -a
    Linux node1 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC
    2015 x86_64 x86_64 x86_64 GNU/Linux

//lsb_release是查看LSB标准的包容性的Linux版本号,-a是列出全数的连锁音讯

杀鸡取蛋措施:yum install redhat-lsb -y

[root@hadoop2 etc]# cat hosts.allow
#
# hosts.allow This file contains access rules which are used to
# allow or deny connections to network services that
# either use the tcp_wrappers library or that have been
# started through a tcp_wrappers-enabled xinetd.
#
# See ‘man 5 hosts_options’ and ‘man 5 hosts_access’
# for information on rule syntax.
# See ‘man tcpd’ for information on tcp_wrappers
#
[root@hadoop2 etc]# cat hosts.deny
#
# hosts.deny This file contains access rules which are used to
# deny connections to network services that either use
# the tcp_wrappers library or that have been
# started through a tcp_wrappers-enabled xinetd.
#
# The rules in this file can also be set up in
# /etc/hosts.allow with a ‘deny’ option instead.
#
# See ‘man 5 hosts_options’ and ‘man 5 hosts_access’
# for information on rule syntax.
# See ‘man tcpd’ for information on tcp_wrappers
#
[root@hadoop2 etc]# pwd
/etc
[root@hadoop2 etc]# uname -a
Linux hadoop2 2.6.32-642.6.2.el6.x86_64 #1 SMP Wed Oct 26 06:52:09 UTC
2016 x86_64 x86_64 x86_64 GNU/Linux
[root@hadoop2 etc]# cat /proc/version
Linux version 2.6.32-642.6.2.el6.x86_64
(mockbuild@worker1.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat
4.4.7-17) (GCC) ) #1 SMP Wed Oct 26 06:52:09 UTC 2016
[root@hadoop2 etc]# 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.8 (Final)
Release: 6.8
Codename: Final
[root@hadoop2 etc]# lsb_release
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
[root@hadoop2 etc]#

[root@node1 ~]# uname -r
2.6.32-573.el6.x86_64
2. cat /proc/version 查看内核版本gcc版本linux
[root@node1 ~]# cat /proc/version
Linux version 2.6.32-573.el6.x86_64
(mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red
Hat 4.4.7-16) (GCC) ) #1 SMP Thu Jul 23 15:44:03 UTC 2015
3. lsb_release -a 列出所有版本信息,查看系统发行版本信息,centos版本如果没有此命令可以执行yum install lsb安装linux
[root@node1 ~]# 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.7 (Final)
Release: 6.7
Codename: Final
4. cat /etc/issue 查看系统版本linux
[root@node1 ~]# cat /etc/issue
CentOS release 6.7 (Final)
Kernel \r on an \m

//如果lsb_release指令展现不存在,那么能够通过设置lsb_release来实行该指令#yum
-y redhat-lsb

安装完事后再查看版本新闻:

 

5. centos系统执行cat /etc/redhat-release 查看系统版本信息linux
[root@node1 ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)
6. 执行 getconf LONG_BIT可以查看linux系统位数linux
[root@node1 ~]# getconf LONG_BIT
64
“`

//内核版本查看格局是在/proc/version/中查阅:#cat
/proc/version
或者是#uname
-a
,界面显示是2.6.32-504.3.3.el6.x86_64的基业版本

[root@localhost upload]# lsb_release -a
LSB Version:
: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.3 (Final)
Release: 6.3
Codename: Final

//也足以经过/etc/issue文件查看:#cat /etc/issue,界面突显是CentOS
release 6.9 (Final)  Kernel \r on an \m,也就是6.9版本的CentOS

//本指令#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.9 (Final)
Release: 6.9
Codename: Final

LSB是Linux Standard
Base的缩写,lsb_release命令用来体现LSB和一定版本的连带信息。

 

2.查看该服务器是否早已设置了Mysql

#whereis mysql        或            #find /* -name “mysql”     
        
或者             #mysql       或者      #service
mysqld status

//平常景况下是显示:#      或         #        或       No such file
or directory       或     unrecognized service那多种终端回复突显

//假若设置了mysql打算重装,能够用remove指令先卸载再进行前边的步骤:#yum -y
remove mysqld mysql mysql-server

 

3.上边是重点了,安装Mysql

#yum -y install mysqld mysql mysql-server

//此次服务器安装的最终两行展现:

Installed:
mysql.x86_64 0:5.1.73-8.el6_8 mysql-server.x86_64 0:5.1.73-8.el6_8

Complete!

//假使现身了其余标题,将报错提醒百度时而,你就明白

澳门金沙国际 , 

4.装置了随后吧,你要看Mysql是还是不是在运行啊

#service mysqld status

//界面展现的是:mysqld is
stoppd,既然它甘休运行了,运营就完事儿了,#service mysqld
start
(偷懒操作,按一下↑,然后BackSpace按三下,输入rt再回车就完事儿了)

//而是本人的界面反馈好像细小对:

/usr/bin/mysqladmin: error while loading shared
libraries: libmysqlclient.so.16: cannot
open shared object file: No such file or directory
Cannot check for MySQL Daemon startup because of mysqladmin failure.
Starting mysqld: [FAILED]

//它告诉自个儿,作者少了3个mysql的依靠包,度娘以往得知:#yum -y reinstall
mysql-libs
重新安装那个包就完事儿了

//然后此起彼伏运行服务#service mysqld
start
,那么难点来了,小编想关它怎么做:把start换来stop就好了

//平常展现的是:Starting mysqld: [ OK ]

 

5.登录Mysql

#mysql -uroot -proot

//使用root账户登录mysql成功

相关文章