zoukankan      html  css  js  c++  java
  • mysql_config_editor 安全登录方式

     mysql_config_editor 安全登录方式

    # 管理员用户

    [root@db143 bak]# /usr/local/mysql/bin/mysql_config_editor set --login-path=instance_3306_root --host=localhost --user=root --port=3306 --password --socket='/data/mysql/mysql_3306/tmp/mysql_3306.sock' 
    Enter password: 
    [root@db143 bak]#

    # 备份用户

    [root@db143 bak]# /usr/local/mysql/bin/mysql_config_editor set --login-path=instance_3306_bak --host=localhost --user=bak --port=3306 --password --socket='/data/mysql/mysql_3306/tmp/mysql_3306.sock'
    Enter password: 
    [root@db143 bak]#

    # 打印

    [root@db143 bak]# /usr/local/mysql/bin/mysql_config_editor print --all
    [instance_3306_bak]
    user = bak
    password = *****
    host = localhost
    socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock
    port = 3306
    [instance_3306_root]
    user = root
    password = *****
    host = localhost
    socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock
    port = 3306
    [root@db143 bak]#

    # 帮助信息

    [root@db145 ~]# /usr/local/mysql/bin/mysql_config_editor --help       
    /usr/local/mysql/bin/mysql_config_editor  Ver 8.0.18 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
    Copyright (c) 2012, 2019, 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.
    Usage: /usr/local/mysql/bin/mysql_config_editor [program options] [command [command options]]
      -#, --debug[=#]     This is a non-debug version. Catch this and exit.
      -?, --help          Display this help and exit.
      -v, --verbose       Write more information.
      -V, --version       Output version information and exit.
    
    Variables (--variable-name=value)
    and boolean options {FALSE|TRUE}  Value (after reading options)
    --------------------------------- ----------------------------------------
    verbose                           FALSE
    
    Where command can be any one of the following :
           set [command options]     Sets user name/password/host name/socket/port
                                     for a given login path (section).
           remove [command options]  Remove a login path from the login file.
           print [command options]   Print all the options for a specified
                                     login path.
           reset [command options]   Deletes the contents of the login file.
           help                      Display this usage/help information.
    
    [root@db145 ~]# 

    # 示例

    [root@db145 ~]# /usr/local/mysql/bin/mysql_config_editor print --help      
    /usr/local/mysql/bin/mysql_config_editor  Ver 8.0.18 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
    Copyright (c) 2012, 2019, 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: Print the contents of login file in unencrypted form.
    Usage: /usr/local/mysql/bin/mysql_config_editor [program options] [print [command options]]
      --all               Used with print command to print all login paths.
      -?, --help          Display this help and exit.
      -G, --login-path=name 
                          Name of the login path to use in the login file. (Default
                          : client)
    
    Variables (--variable-name=value)
    and boolean options {FALSE|TRUE}  Value (after reading options)
    --------------------------------- ----------------------------------------
    all                               FALSE
    login-path                        client
    [root@db145 ~]# /usr/local/mysql/bin/mysql_config_editor print --login-path=instance_3306_bak
    [instance_3306_bak]
    user = bak
    password = *****
    host = localhost
    socket = /data/mysql/mysql_3306/tmp/mysql_3306.sock
    port = 3306
    [root@db145 ~]# 
  • 相关阅读:
    Lua 语言学习
    Unity EasyTouch官方案例学习
    Unity Dotween官方案例学习
    斗地主出牌规则
    C# XML文件读取
    斗地主项目总结
    C# 委托和事件
    C# 观察者模式
    消防法及相关法律法规(二)
    消防法及相关法律法规(一)
  • 原文地址:https://www.cnblogs.com/bjx2020/p/12118490.html
Copyright © 2011-2022 走看看