Host slave1 has ip address 192.0.2.10.
Host slave2 has ip address 203.0.113.50
Examine these commands:
Why did this error occur?
A. The host on the command line is not defined in the login path.
B. The mysqld instance has not been restarted after creating the login path.
C. There is no password defined in the login path.
D. The DNS is not configured correctly for slave1 host.
E. The mylogin.cnf file is not readable.
Answer: C
mysql_config_editor 出现在 mysql5.6.6 以后的版本, 可以给指定的连接和密码生成一个加密文件.mylogin.cnf, 默认位于当前用户家目录下。 通过该文件可以使用 mysql、 mysqladmin 等直接登录, 避免明文密码出现在脚本中。配置好后的查询命令是:
[root@mysql57 ~]# mysql_config_editor set --user=root --password --host=localhost
Enter password:
[root@mysql57 ~]# mysql_config_editor print --all
[client]
user = root
password = *****
host = localhost
原题打印的缺失 password,表明没有录入密码, 但是有-p, 密码输入对了也是可以登录的