February 18 2016


遮蔽验证选项 mysql_config_editor

使用 mysql_config_editor 可创建加密的选项文件。
• 在专用的选项文件中存储用户、口令和主机选项:
– 当前用户的主目录中 .mylogin.cnf。
– 要指定替代文件名,请设置MYSQL_TEST_LOGIN_FILE环境变量。
.mylogin.cnf 文件包含登录路径。
– 类似于选项组
– 每个登录路径包含单个身份的验证信息
– 客户机使用 –login-path 命令行选项引用登录路径
mysql –login-path=admin

mysql_config_editor –login-path=<login-path> –user=<user> –password

mysql_config_editor print –login-path=<login-path>

mysql_config_editor print –all
默认登录路径名称为client 被所有标准客户机读取
[root@mysql ~]# mysql_config_editor help
mysql_config_editor Ver 1.0 Distrib 5.6.28, for Linux 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

MySQL Configuration Utility.
Usage: mysql_config_editor [program options] [command [command options]]
-?, –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.

Copyright 2019. All rights reserved.

Posted 2016年2月18日 by ucjmh in category "mysql

Leave a Reply

Your email address will not be published. Required fields are marked *