biotwang 发表于 2016-7-19 16:45:51

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

本帖最后由 biotwang 于 2016-7-19 17:09 编辑


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

7.

Consider the Mysql Enterprise Audit plugin.
You are checking user accounts and attempt the following query:mysql> SELECT user, host FROM mysql.users;
ERROR 1146 (42S02): Table ‘mysql.users’ doesn’t existWhich subset of event attributes would indicate this error in the audit.log file?

A.NAME=”Query”
STATUS=”1146”
SQLTEXT=”select user,host from users”/>B.NAME=”Error”
STATUS=”1146”
SQLTEXT=”Error 1146 (42S02): Table ‘mysql.users’ doesn’t exist”/>C.NAME=”Query”
STATUS=”1146”
SQLTEXT=” Error 1146 (42S02): Table ‘mysql.users’ doesn’t exist”/>D.NAME=”Error”
STATUS=”1146”
SQLTEXT=”select user,host from users”/>E.NAME=”Error”
STATUS=”0”
SQLTEXT=”Error 1146 (42S02): Table ‘mysql.users’ doesn’t exist”/>---------------------------------------------------------
答案:A

分析:
注意:MySQL Enterprise Audit是包含在MySQL企业版中的一个扩展插件,因此如果你在学习时使用的是社区版的MySQL,那你是无法实验的。
因为它需要在环境变量plugin_dir对应目录下存在audit_log.so插件文件。
从选择答案中可知,Audit log中使用的是旧格式进行的记录。
由于SQLTEXT仅在NAME为Query或Execute时,才会有出现,且NAME不存在Error状态。因此B,D,E错。
而SQLTEXT仅存放所使用的SQL语句。而返回的状态存放在STATUS下,0为成功,非0为报错号,因此A对C错。

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