码迷,mamicode.com
首页 > 数据库 > 详细

mysql_config_editor 安全登录方式

时间:2019-12-30 11:42:03      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:sql   bak   variables   bsp   class   orm   pre   his   client   

 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 ~]# 

mysql_config_editor 安全登录方式

标签:sql   bak   variables   bsp   class   orm   pre   his   client   

原文地址:https://www.cnblogs.com/bjx2020/p/12118490.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!