zoukankan      html  css  js  c++  java
  • orzdba在5.6安装

    前言:淘宝的orzdba查看MySQL服务器当前QPS,TPS很方便,但是不少人反应,在5.6原本好用的工具不好用了,频繁出现这样警告:

    Warning: Using a password on the command line interface can be insecure.根本无法看

    下面就来讲在5.6怎么安装orzdba

    (1)安装依赖包

    wget http://code.taobao.org/p/orzdba/src/trunk/orzdba_rt_depend_perl_module.tar.gz

    ##提示这个要安装相应的包

    Can't locate ExtUtils/Embed.pm in @INC (@INC contains: /usr/local/lib64/perl5, yum install cpan perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker perl-ExtUtils-Embed -y

    ###

    tar xvf orzdba_rt_depend_perl_module.tar.gz cd Perl_Module/

    安装version模块:

    tar -zxvf version-0.99.tar.gz

    cd version-0.99

    perl Makefile.PL

    make make install 安装Class-Data-Inheritable模块:

    tar -zxvf Class-Data-Inheritable-0.08.tar.gz

    cd Class-Data-Inheritable-0.08

    perl Makefile.PL

    make make install

    安装Module-Build模块:

    tar -zxvf Module-Build-0.31.tar.gz

    cd Module-Build-0.31

    perl Build.PL

    ./Build

    ./Build test

     ./Build install 安装File::Lockfile模块:

    tar -zxvf File-Lockfile-v1.0.5.tar.gz

    cd File-Lockfile-v1.0.5

    perl Build.PL

    perl ./Build perl ./Build install

    (2)密码安全问题解决

    [root@ ~]# mysql -uroot -p'xxxxx' -s

    Warning: Using a password on the command line interface can be insecure.

    (db)root@localhost [(none)]>

    MySQL加强了密码安全,如果在命令行输入密码,会出现这个警告,这个警告会影响orzdba展示页面,解决这个烦人的警告可以通过下面两个方法

    1.把数据库密码写到my.cnf配置文件里面

    2.同样利用mysql5.6的新特性, mysql_config_edit,可以用来加密用户的密码,消除警告

    mysql_config_editor set --help
    mysql_config_editor Ver 1.0 Distrib 5.6.24, for linux-glibc2.5 on x86_64
    Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    MySQL Configuration Utility.
    
    Description: Write a login path to the login file.
    Usage: mysql_config_editor [program options] [set [command options]]
      -?, --help          Display this help and exit.
      -h, --host=name     Host name to be entered into the login file.
      -G, --login-path=name 
                          Name of the login path to use in the login file. (Default
                          : client)
      -p, --password      Prompt for password to be entered into the login file.
      -u, --user=name     User name to be entered into the login file.
      -S, --socket=name   Socket path to be entered into login file.
      -P, --port=name     Port number to be entered into login file.
      -w, --warn          Warn and ask for confirmation if set command attempts to
                          overwrite an existing login path (enabled by default).
                          (Defaults to on; use --skip-warn to disable.)
    
    Variables (--variable-name=value)
    and boolean options {FALSE|TRUE}  Value (after reading options)
    --------------------------------- ----------------------------------------
    host                              (No default value)
    login-path                        client
    user                              (No default value)
    socket                            (No default value)
    port                              (No default value)
    warn                              TRUE

    [root@~]# mysql_config_editor set --login-path=login --user=root --password 然后输入密码

    [root@~]#  mysql_config_editor print --all

    [login] user = root password = ***** host = localhost

    [root@ ~]# 加密过后的文件是二进制文件不能够直接读出

    [root@ ~]# cat .mylogin.cnf    

      §Z[root@ ~]# ???=s??μ¤??¢ A^Z??o????~

    [root@ ~]#

    [root@ ~]#  mysql --login-path=login -s

    (db)root@localhost [(none)]>

    烦人的警告没了

    然后就是要修改一下orzdba,

    [root@~]#vim orzdba

    gg 160 ##找到160

    my $MYSQL    = qq{mysql -s --skip-column-names -uroot -P$port };

    修改为

    my $MYSQL    = qq{mysql --login-path=login -s --skip-column-names };

    保存, 大功告成,下面来看看结果

     

    参考资料:

    http://code.taobao.org/p/orzdba/src/trunk/

    http://docs.oracle.com/cd/E17952_01/refman-5.6-en/mysql-config-editor.html

  • 相关阅读:
    AcWing 125. 耍杂技的牛
    AcWing 148. 合并果子
    AcWing 907. 区间覆盖
    AcWing 908. 最大不相交区间数量
    AcWing 906. 区间分组
    AcWing 905. 区间选点
    AcWing 285. 没有上司的舞会
    AcWing 1049. 大盗阿福
    AcWing 901. 滑雪
    AcWing 91. 最短Hamilton路径
  • 原文地址:https://www.cnblogs.com/LMySQL/p/4885268.html
Copyright © 2011-2022 走看看