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 ~]# 
  • 相关阅读:
    微信小程序开发工具初始化代码仓库
    微信小程序开发如何初始化远程仓库并 PUSH
    Git 提示用户密码错误如何修改
    MariaDB 在创建外键的时候提示 1005 错误
    Fiddler实现移动端手机抓包
    Windows 安装 Go语言开发环境以及使用
    laravel队列,事件简单使用方法
    视图
    laravel Passport
    多台服务器 同时部署一套代码
  • 原文地址:https://www.cnblogs.com/bjx2020/p/12118490.html
Copyright © 2011-2022 走看看