biotwang 发表于 2016-7-19 17:23:16

【dbdao.com MySQL OCP认证专题】- MySQL 5.6 - OCP 考题讲解 - 10

【dbdao.com MySQL OCP认证专题】- MySQL 5.6 - OCP 考题讲解

10.

You have a login-path named "adamlocal" that was created by using the mysql_config_editor command.
You need to check what is defined for this login_path to ensure that it is correct for your deployment.
You execute this command:$ mysql_config_editor print –-login-path=adamlocalWhat is the expected output of this command?

A. The command prints all parameters for the login-path. The password is printed in plain text.
B. The command prints all parameters for the login-path. The password is shown only when you provide the --password option.
C. The command prints all parameter for the login-path. The password is replaced with stars.
D. The command prints the encrypted entry for the login-path. The is only possible to see if an entry exists.

---------------------------------------------------
答案:C

分析:
mysql_config_editor工具命令用于建立外部登陆文件,一般由mysql客户端或应用来使用,好处在于登陆时免去输入登陆密码,密码已经被保存在了登陆文件中。在环境变量MYSQL_TEST_LOGIN_FILE未设置的情况下,mysql_config_editor默认文件名为.mylogin.cnf,且文件保存在执行此命令的用户home目录下。
登陆文件建立后,可直接使用以下命令登陆:shell> mysql --login-path=login-path当然,--login-path的默认值为client,因此如果你使用mysql_config_editer set --login-path=client 来进行用户密码设置设置,那么登陆所设用户的时候,连--login-path也可不用了:shell> mysqlA, D错,因为不管如何,你都看不到密码的,密码被加密保存后,使用mysql_config_editor print会将密码替代以星号显示。
B错,使用mysql_config_editor --help可知在参数项中没有此--password项,且通过参考文档可知--password是用于设置密码而非显示密码的。
C正确。


参考:
http://dev.mysql.com/doc/refman/5.7/en/mysql-config-editor.html
页: [1]
查看完整版本: 【dbdao.com MySQL OCP认证专题】- MySQL 5.6 - OCP 考题讲解 - 10