MySQL 8.0 OCP 英文题库解析(十)

Oracle 为庆祝 MySQL 30 周年,截止到 2025.07.31 之前。所有人均可以免费考取原价245美元的MySQL OCP 认证。

从今天开始,将英文题库免费公布出来,并进行解析,帮助大家在一个月之内轻松通过OCP认证。

本期公布试题81~90

试题81:

复制代码
Choose four.Which four are types of information stored in the MySQL data dictionary? 
H)access control lists [正确] 
C)performance metrics [错误] 
B)server configuration rollback [错误] 
F)view definitions [正确] 
G)table definitions. [正确] 
E)InnoDB buffer pool LRU management data [错误] 
A)server runtime configuration [错误] 
D)stored procedure definitions [正确]

MySQL 数据字典中存储的信息类型是哪四种?

解析

language 复制代码
在MySQL数据字典中存储的四种信息类型是:

H) 访问控制列表(access control lists) [正确]
F) 视图定义(view definitions) [正确]
G) 表定义(table definitions) [正确]
D) 存储过程定义(stored procedure definitions) [正确]

其他选项不属于数据字典范畴:
    性能指标(C)、缓冲池LRU数据(E)属于性能监控数据
    服务器配置(A/B)存储在配置文件中或通过SET命令动态设置

试题82:

language 复制代码
Choose two.Examine this statement:mysql>DROP ROLE r_role1, r_role2 ; Which two are true? 
B)You must revoke all privileges from r_role1 and r_role2 before dropping the roles. [错误] 
C)It fails if at least one of the roles does not exist. [正确] 
D)Existing connections can continue to use the roles' privileges until they reconnect. [错误] 
F)It fails if any of the roles is specified in the mandatory_roles variable. [正确] 
A)You must revoke r_role1 and r_role2 from all users and other roles before dropping the roles. [错误] 
E)It fails if you do not have the ADMIN OPTION of the roles r_role1 and r_role2. [错误] 

解析

language 复制代码
在给定的 DROP ROLE r_role1, r_role2; 语句中,正确的两个选项是:

C) 如果至少有一个角色不存在,则该语句会失败。 [正确]
F) 如果任何角色被定义在 mandatory_roles 系统变量中,则该语句会失败。 [正确]
    mandatory_roles 是 MySQL 的系统变量,用于定义所有用户自动继承的角色(如审计角色)。
    这些角色受保护,必须先从 mandatory_roles 中移除才能删除。

A/B) 无需手动撤销权限或角色分配
MySQL 会自动处理依赖关系,删除角色时会自动撤销其授予用户或其他角色的权限。

D) 现有连接不会保留角色权限
角色权限在删除后立即失效,即使当前会话不重连也会失去权限。

E) 不需要 ADMIN OPTION
只有 REVOKE ROLE 需要 ADMIN OPTION,DROP ROLE 需要的是 DROP ROLE 权限。

试题83:

language 复制代码
Choose two.Which two are true about differences between logical and physical upgrades of MySQL 
databases? 
C)Physical upgrades are performed for current instances on bare metal deployments, whereas 
logical upgrades are used for virtual machines or containerized instances. [错误] 
F)Physical upgrades leave data in place, whereas logical upgrades require data to be restored from 
mysqldump-type backups taken before the upgrades. [正确] 
E)Post-upgrade table storage requirements after logical upgrades are usually smaller than that after 
physical upgrades. [正确] 
A)Logical upgrades are much faster because they do not require restarting the mysqld process. [错
误] 
D)Post-upgrade table storage requirements after physical upgrades are usually smaller than that 
after logical upgrades. [错误] 
B)Physical upgrades are much faster because they do not require restarting the mysqld process. [错
误] 

解析

language 复制代码
在MySQL数据库的逻辑升级(Logical Upgrade)和物理升级(Physical Upgrade)之间的差异中,正确的两个选项

    A) 逻辑升级更快(错误)

        逻辑升级涉及数据导出/导入,通常比物理升级慢。

    B) 物理升级不需要重启(错误)

        物理升级必须重启 MySQL 服务以加载新版本。

    C) 物理升级仅用于裸机,逻辑升级用于虚拟机/容器(错误)

        升级方式与部署环境无关,两种方法均可用于任何环境。

    D) 物理升级后存储更小(错误)

        物理升级沿用旧数据文件,可能包含碎片,而逻辑升级会优化存储。

    F) 物理升级会保留原有数据,而逻辑升级需要从升级前的 mysqldump 备份中恢复数据。 [正确]

    E) 逻辑升级后的表存储空间通常比物理升级后更小。 [正确]

试题84:

language 复制代码
Choose two.On examination, your MySQL installation datadir has become recursively world 
read/write/ executable.What are two major concerns of running an installation with incorrect file 
privileges? 
A) Extra startup time would be required for the MySQL server to reset the privileges. [错误] 
C) SQL injections could be used to insert bad data into the database. [错误] 
D) Data files could be deleted. [正确] 
E) Users could overwrite configuration files. [正确] 
B) MySQL binaries could be damaged, deleted, or altered. [错误]

##解析

language 复制代码
在 MySQL 的 datadir 目录权限被错误地设置为全局可读/写/执行(world read/write/executable)时,两个主要的安全风险是

D) 数据文件可能被删除。 [正确]

E) 用户可能覆盖配置文件。 [正确]

A) MySQL 启动时需要额外时间重置权限(错误)
        MySQL 不会自动修复文件权限,必须手动修复(如 chmod -R 750 /var/lib/mysql)。

B) MySQL 二进制文件可能被破坏(错误)
        datadir 仅存储数据文件,二进制文件通常位于 /usr/bin/ 或 /usr/sbin/,除非它们也被错误配置,否则不受直接影响。

C) SQL 注入可插入恶意数据(错误)
        SQL 注入是应用程序层漏洞,与文件系统权限无关。

试题85:

复制代码
Choose two.You made some table definition changes to a schema in your MySQL Server.Which two 
statements reflect how MySQL Server handles the table definition changes? 
D)The metadata is serialized in (SDI). [正确] 
B)MySQL writes SDI to the binary log for distributed backups. [错误] 
A)MySQL Server stores a copy of the serialized data in the InnoDB user tablespace. [正确] 
E)MySQL keeps InnoDB metadata changes in .sdi files in datadir. [错误] 
C)MySQL implicitly executes FLUSH TABLES and stores a snapshot backup of the metadata. [错误] 

解析

language 复制代码
MySQL 服务器处理表定义更改时,正确的两个描述是

     D) 元数据被序列化存储在 SDI(Serialized Dictionary Information)中。 [正确]

     A) MySQL 服务器在 InnoDB 用户表空间(表的数据文件)中存储序列化数据的副本。 [正确]
    B) SDI 写入二进制日志(错误)
        二进制日志(binlog)记录的是 SQL 语句或行变更,而非 SDI 元数据。

    C) 隐式执行 FLUSH TABLES 并存储元数据快照(错误)
        MySQL 不会自动创建元数据快照,而是通过 SDI 和数据字典实时管理。

    E) 元数据存储在 .sdi 文件(错误)
        SDI 直接嵌入表空间文件(.ibd),不会生成单独的 .sdi 文件(这是早期版本的误解)。


MySQL 8.0+ 通过 SDI + InnoDB 表空间存储元数据,确保表定义更改的 原子性和持久性。
关键点:
    SDI 是 JSON 格式的序列化元数据,存储在 .ibd 文件中(D 正确)。
    不依赖外部文件或二进制日志(B/E 错误)。
    无自动快照机制(C 错误)。

试题86:

language 复制代码
Choose three.Which three settings control global buffers shared by all threads on a MySQL server? 
E)key_buffer_size [正确] 
F)read_buffer_size [错误] 
A)tmp_table_size [错误] 
D)sort_buffer_size [错误] 
B)innodb_buffer_pool_size [正确] 
C)table_open_cache [正确] 

解析

由所有线程共享的全局缓冲区(global buffers)的三个关键配置参数是

language 复制代码
E) key_buffer_size [正确]
作用:用于 MyISAM 存储引擎 的索引缓存(所有线程共享)。

B) innodb_buffer_pool_size [正确]
作用:定义 InnoDB 存储引擎 的缓冲池大小(数据和索引的缓存)。

C) table_open_cache [正确]
作用:控制 表描述符缓存 的大小(所有线程共享)。

F) read_buffer_size:每个线程独享,用于顺序扫描的缓冲区(非全局)。

A) tmp_table_size:控制 临时表的内存大小(每个连接独立使用,非全局共享)。

D) sort_buffer_size:每个线程独享,用于排序操作的缓冲区(非全局)。

试题87:

language 复制代码
Choose two.You are using mysqlcheck for server maintenance. Which two statements are true? 
E)The mysqlcheck --optimize --all-databases command reclaims free space from table files. [正确] 
D)The mysqlcheck command can be renamed mysqlrepair so that it repairs tables by default. [正确] 
B)The mysqlcheck --repair --all-databases command can repair an InnoDB corrupted table. [错误] 
A)The mysqlcheck --check --all-databases command takes table write locks while performing a series of checks. [错误] 
C)The mysqlcheck --analyze --all-databases command performs a series of checks to spot eventual 
table corruptions. [错误] 

解析

language 复制代码
在 MySQL 维护工具 mysqlcheck 的使用中,正确的两个描述是:

E) mysqlcheck --optimize --all-databases 命令可以回收表文件中的空闲空间。 [正确]

D) mysqlcheck 命令可以重命名为 mysqlrepair,使其默认执行修复操作。 [正确]

B) mysqlcheck --repair 可修复损坏的 InnoDB 表(错误)
    mysqlcheck --repair 仅适用于 MyISAM/ARCHIVE 等存储引擎,InnoDB 表损坏需使用 innodb_force_recovery 或数据恢复工具。

A) mysqlcheck --check 会加写锁(错误)
    --check 默认使用 读锁(READ),除非指定 --lock-tables 或 --check-only-changed。

C) mysqlcheck --analyze 用于检测表损坏(错误)
    --analyze 是更新表的统计信息(ANALYZE TABLE),不用于检测损坏,检测应使用 --check。

试题88:

language 复制代码
Which two MySQL Server accounts are locked by default?  
E)any user set as DEFINER for stored programs [错误] 
B)any user created without a password [错误] 
C)any internal system accounts  [正确] 
A)any new ROLE accounts  [正确] 
D)any user created with a username, but missing the host name [错误]

解析

language 复制代码
在 MySQL 中,默认被锁定的两个账户类型是:

C) 任何内部系统账户(any internal system accounts) [正确]
    MySQL 8.0+ 引入了内部系统账户(如 'mysql.sys'@'localhost'、'mysql.session'@'localhost'),用于管理存储过程、视图和会话控制。
    默认锁定:这些账户无法直接登录,仅用于内部操作,防止被恶意使用。

A) 任何新的 ROLE 账户(any new ROLE accounts) [正确]
    ROLE(角色) 在创建时默认是 LOCKED 状态(MySQL 8.0+)。
    原因:角色本身不能直接登录,需通过 GRANT ROLE TO user 分配给用户后生效。

B) 未设置密码的用户(错误)
        MySQL 8.0+ 强制要求密码,创建用户时若未指定密码会报错(除非显式设置 PASSWORDLESS_USER_ADMIN 权限)。

D) 缺少主机名的用户(错误)
        用户名必须包含主机名(如 'user'@'%'),否则语法错误,与锁定无关。

E) 存储程序的 DEFINER(错误)
        DEFINER 是程序创建者账户,其锁定状态取决于具体配置,无默认锁定。

试题89:

复制代码
Choose three.Your MySQL server is running on the Microsoft Windows platform. Which three local 
connection protocols are available to you? 
D)named pipes [正确] 
E)X Protocol [错误] 
C)SOCKET [错误] 
B)shared memory [正确] 
F)TCP/IP [正确] 
A)UDP [错误]

解析

language 复制代码
 Windows 平台 上运行的 MySQL 服务器,可用的 本地连接协议 包括以下三个选项:

D) Named Pipes(命名管道) [正确]
B) Shared Memory(共享内存) [正确]
F) TCP/IP(本地回环地址 127.0.0.1) [正确]
E) X Protocol:用于 MySQL Shell 的 NoSQL 接口,不限于本地连接。
C) SOCKET:Unix/Linux 的本地套接字文件(.sock),Windows 不支持。
A) UDP:MySQL 不依赖 UDP,其连接基于 TCP/IP 或特定 IPC 机制。

试题90:

复制代码
Which two authentication plugins require the plain text client plugin for authentication to work? 
B)PAM authentication [正确] 
A)Windows Native authentication [错误] 
E)SHA256 authentication [错误] 
C)LDAP SASL authentication [错误] 
F)MySQL Native Password [错误] 
D)LDAP authentication [正确] 

解析

language 复制代码
在 MySQL 中,需要客户端明文密码(plain text)进行身份验证的两个认证插件是:

B) PAM authentication(PAM 认证) [正确]
D) LDAP authentication(LDAP 认证) [正确]

    A) Windows Native 认证:使用 Windows SSPI(Security Support Provider Interface),无需明文密码,依赖 Windows 安全上下文。

    E) SHA256 认证:使用加密哈希(如 caching_sha2_password),客户端发送加密后的密码,无需明文。

    F) MySQL Native Password:使用旧版 mysql_native_password 插件,客户端发送哈希值,无需明文。

    C) LDAP SASL 认证:支持加密机制(如 Kerberos),不依赖明文密码。
相关推荐
天天摸鱼的java工程师6 小时前
高考放榜夜,系统别崩!聊聊查分系统怎么设计,三张表足以?
java·后端·mysql
exe4526 小时前
jdbc查询mysql数据库时,出现id顺序错误的情况
数据库·mysql
Johny_Zhao8 小时前
阿里云数据库Inventory Hint技术分析
linux·mysql·信息安全·云计算·系统运维
loserkk8 小时前
MySQL InnoDB 5.7 索引失效场景解析:原理与案例
mysql
L.S.V.9 小时前
MYSQL(三)--服务器启动参数与配置
服务器·数据库·mysql
有时间要学习10 小时前
MySQL——视图 && 用户管理 && 语言访问
数据库·mysql
艾露z11 小时前
深度解析Mysql中MVCC的工作机制
java·数据库·后端·mysql
全职计算机毕业设计12 小时前
SpringBoot+Mysql实现的停车场收费小程序系统+文档
spring boot·mysql·小程序
AirMan12 小时前
SQL语句中,为什么group by能够提前"预知"select的别名?
mysql
Lx35214 小时前
UNION ALL与UNION的性能差异及选择技巧
sql·mysql·oracle