MySQL 8.0 OCP 1Z0-908 61-70题

Q61.You wish to protect your MySQL database against SQL injection attacks.

Which method would fail to do this?

A)using stored procedures for any database access

B)using PREPARED STATEMENTS

C)installing and configuring the Connection Control plugin ( 该插件可以延缓暴力SQL注入攻击,但是不能避免)

D)avoiding concatenation of SQL statements and user-supplied values in an application

Answer:C

Q62.Which two statements are true about MySQL server multi-source replication?

A)It relies on relay_log_recovery for resilient operations.

B)It does not attempt to detect or resolve replication conflicts.

C)It needs to be re-instanced after a crash to maintain consistency.//虽然在某些情况下可能需要重新配置从服务器,但多主复制本身并不需要在每次崩溃后都重新实例化来保持一致性

D)It is not compatible with auto-positioning. //多主复制可以使用 GTID 自动定位(auto-positioning),这有助于从服务器在重启后自动恢复复制。

E)It must use GTID replication.//也可以基于二进制日志

F)It uses only time-based replication conflict resolution.//多主复制没有基于时间的冲突检测机制

Answer:AB

注意:

多主复制,不一定是MGR的多主(由于没使用过多主复制,所以我一看到多主就联想到了MGR的多主模式,走进了思维误区,顺便给和我有一样想法的小伙伴提个醒)

relay_log_recovery:启用该参数后,从库如果发生故障导致relay log丢失,那么在数据库启动后立即启动自动relay log恢复,在恢复过程中,创建一个新的relay log文件,将sql线程的位置初始化到新的relay log,并将i/o线程初始化到sql线程位置

Q63.You are using an existing server with a new configuration. MySQL Server fails to start. Examine this snapshot of

the error log:

190925 12:49:05 InooDB; Initializing buffer pool,size=3.0G

190925 12:49:05 InooDB; Completed Initializing of buffer poo
InnoDB:Error:log file ./ib_logfiiel0 is of different size 0 5242880 bytes
InnoDB than specified in the .cnf fiel 0 26214400 bytes 1 (遇到该报错,删除掉该文件就好了)

190925 12:49:05 [ERROR] Plugin 'InnoDB' init function returned error.

190925 12:49:05 [ERROR] Plugin 'InnoDB'registation as a STORAGE PNGINR failed

190925 12:49:05 [ERROR] Plugin 'Aborting

190925 12:49:05 [ERROR] Plugin '/usr/sbin/mysqld:Shutdown complete

Which action would allow the server to start?

A)Remove ib_logfile0 and ib_logfile1 files from the file system.

B)Execute mysqladmin flush-logs.

C)First run mysqld --initialize to refresh the size of ib_logfile.

D)Create a new ib_logfile0 file of size 26214400.

Answer:A

Q64.User account baduser@hostname on your MySQL instance has been compromised. Which two commands

stop any new connections using the compromised account?

A)ALTER USER baduser@hostname ACCOUNT LOCK; //锁定账号就无法登录

B)ALTER USER baduser@hostname PASSWORD DISABLED; //没见过这个,知道的麻烦帮忙解释下

C)ALTER USER baduser@hostname MAX_USER_CONNECTIONS 0;//这条命令限制用户的并发连接数为 0,意味着该用户不能建立任何连接。它适用于立即阻止用户访问数据库,但保留用户及其其他权限不变。

D)ALTER USER baduser@hostname DEFAULT ROLE NONE; //这条命令移除了用户的默认角色,使其在登录时没有任何角色相关的权限。这限制了用户的权限范围,但用户仍可能通过临时角色获得权限。

E)ALTER USER baduser@hostname IDENTIFIED WITH mysql_no_login;//这条命令将用户的身份验证插件设置为 mysql_no_login,明确禁止用户登录。这种更改是直接且彻底的,适用于确定不再需要用户登录的场景。

Answer:AE

Q65.Your MySQL server is running on the Microsoft Windows platform. Which three local connection protocols are

available to you?

A)UDP

B)TCP/IP //MySQL默认使用的TCP/IP协议

C)X Protocol //用于 MySQL Router 和 MySQL Shell 等组件,支持 X DevAPI

D)named pipes //Windows 上的命名管道允许进程间通信,MySQL 可通过此方式与客户端通信

E)shared memory //允许 MySQL 服务器和客户端通过共享内存进行快速通信,适用于同一台机器上的连接

F)SOCKET //通常与 Unix 系统相关,

Answer:BDE

Q66.Four nodes are configured to use circular replication.

Examine these configuration parameters for each node:

slave_parallel_type=DATABASE

slave_parallel_workers=4

slave_preserve_commit_order=0

Which statement is true?

A)Setting slave_parallel_type=DATABASE won't work for circular replication; it should be set to LOGICAL_CLOCK.//slave_parallel_type=DATABASE 在循环复制中是可行的,它允许每个从线程处理一个特定的数据库。循环复制本质上是多源复制的一种形式,支持基于数据库的并行复制

B)Setting slave_preserve_commit_order to ON will improve data consistency.

slave_preserve_commit_order=0 意味着不保证事务的提交顺序,可能导致跨数据库约束问题。正确陈述应强调可能的数据不一致风险,而不是改善数据一致性。

C)Cross-database constraints can cause database inconsistency.

当 slave_preserve_commit_order=0 时,事务可能按不同顺序提交,若存在跨数据库约束(如外键),可能导致数据不一致

D)Each slave thread is responsible for updating a specific database.

slave_parallel_type=DATABASE 表示每个从线程负责更新一个特定的数据库

E)Increasing slave_parallel_workers will improve high availability.

增加 slave_parallel_workers 可以提高复制速度,但与高可用性无直接关联。

F)Setting transaction_allow_batching to ON will improve data consistency.

transaction_allow_batching 通常与性能优化相关,而不是直接影响数据一致性。

Answer:C

Q67.Examine this command, which executes successfully:

$ mysqlrouter --bootstrap user@hostname:port --directory=directory_path

--bootstrap:表示要进行初始化操作

--directory:指定要生成的配置文件和数据文件路径

Which activity is performed?

A)MySQL Router is restarted.

B)MySQL Router configures all the cluster nodes based on the information retrieved from the InnoDB cluster metadata

server.//虽然命令会从元数据服务器获取集群信息用于配置,但"配置所有集群节点"这一说法不准确。

C)MySQL Router is configured based on the information in files in directory_path.//命令是基于从元数据服务器获取的信息进行配置,而不是基于目录中的文件

D)MySQL Router configures itself based on the information retrieved from the InnoDB cluster metadata server. //--bootstrap 参数指示 mysqlrouter 进行自我配置,基于从 InnoDB 集群元数据服务器获取的信息创建配置文件

Answer:D

Q68.Which two statements are true about using MySQL Enterprise Monitor Query Analyzer?

A)It is possible to retrieve a normalized statement, but never the exact statement that was executed.

B)The single query QRTi pie chart in the Query Analyzer view is based on the average execution of all statements.

C)It is possible to import data into the Query Analyzer from heterogeneous source, such as CSV.(不支持)

D)It is possible to configure the Query Analysis built-in advisor to get notified about slow query execution.

E)It is possible to list and analyze statements in an arbitrary graph range selection from timeseries graphs.

Answer:DE

Q69.You have just installed MySQL on Oracle Linux and adjusted your /etc/my.cnf parameters to suit your

installation.

Examine the output:

#systemct1 start mysqld

Job for mysqld service failed because the control process exited with error code.See "systemct1 status

mysqld.service"and "journalctl -xe"for details.

systemct1 status mysqld.service

Mysqld.service -MySQL Server

Loaded: loaded( /usr/lib/system/system/mysqld.service;enabled;vendor preset: disabled)

Active: failed (Resut :exit-code) since Thu 2019-12-12 07:54:53 ACDT;33s ago

Docs:man:mysqld(8)

http://dev.mysql.com/doc/refman/en/using-systemd.html

Process:2732 ExecStart=/usr/sbin/mysqld SMYSQLD_OPTS (code=exited,status=1/FAILURE)

Process:2705 ExecStartPre=/usr/sbin/mysqld_pre_systemd(code=exited,status=0/SUCCESS)

Main PID :2732 (code=exited,status=1/FAILURE) //启动的该进程PID=2732

Status:"Server startup in progress" //这表明系统正在尝试启动一个服务,但是服务还没有完全启动完成。这通常出现在你执行了启动命令(如 systemctl start service_name)之后,但服务还没有完全达到运行状态。

DEC 12 07:54:49 oe17 systemd[1]:Starting MySQL Server....

DEC 12 07:54:49 oe17 systemd[1]:mysqld.service:main process exited,code=exited,status=1/FAILURE

DEC 12 07:54:49 oe17 systemd[1]Failed to start MySQL Server.

DEC 12 07:54:49 oe17 systemd[1]:Unit mysqld.service entered failed state.

DEC 12 07:54:49 oe17 systemd[1]:MySQL Server failed

What statement is true about the start attempt?

A)MySQL server was not started due to a problem while executing process 2732.

B)systemd found the mysqld service disabled and failed to start it. //enabled

C)MySQL server continued to start up even though another process existed.

D)systemd waited for 30 seconds before timing out and start up failed.

E)systemd attempted to start mysqld, found another systemd mysqld process running, and shut it down.//正在启动但是没有起来

Answer:A

Which two statements are true?

A)The app user had the highest total number of rows read from storage engines.(比较 rows_examined 列)

B)User bob had the largest total time waiting for locks.

C)The root user had the largest number of modified rows for a select statement.

D)The root user had the largest single wait time.(比较 max_latency)

E)User bob had a significantly higher ratio of SELECT + INSERT statements to QUIT than both app and root users.

(app:2.71;bob:2.71;root:2.71)

Answer:AD

Q70.Examine this query and its output:

Myswl>select * from sys.user_sumary_by_statement_type where statement in ('select','insert',Quit');

+---------+------------+----------+--------------------+----------------+--------------+--------------+------------------

---+----------------+

|user |stsement |total |totsl_latency |max_latency |lock_latency |row_sent |

rows_examined|

Rows_affected |full_scans|

+---------+------------+----------+--------------------+----------------+--------------+--------------+------------------

---+----------------+

|app |select |919866 |2.41 h |330.0ms |1.52 m |542614816 | 542614816

|

0 | 919958 |

|app |insert |923070 |1.66 h |287.41ms |1.65 m | 0 | 0

|

923026 | 0 |

|app |Quit |679892 |9.54 s |170.97ms |0ps | 0 | 0

|

0 | 0 |

|app |select |344964 |53.61h |328.42ms |34.51s | 203509545 | 203509545

|

0 | 344847 |

|app |insert |346159 |37.84m |235.77ms |36.94s | 0 | 0

|

346175 | 0 |

|bob |Quit |254971 |3.65 s |69.97ms |0ps | 0 | 0

|

0 | 0 |

|root |select |230621 |36.88m |21.47s |23.81s |135639074 | |135639074

|

0 | 230595 |

|root |Quit |170363 |2..24 s |130.14ms |0ps | 0 | 0

|

0 | 0 |

+---------+------------+----------+--------------------+----------------+--------------+--------------+------------------

---+----------------+

9 rows in set (0.00sec)

user_summary_by_statement_type视图的列及含义

user:表示客户端的用户名。如果底层性能架构表中USER列的值为NULL,则认为这些行是针对后台线程的,并且会以"background"作为主机名进行报告。

statement:语句事件名称的最后一个组成部分。

total:表示该用户语句事件发生的总次数。

total_latency:表示该用户语句事件发生时的总等待时间。

max_latency:表示该用户语句事件发生时的最大单次等待时间。

lock_latency:表示该用户语句事件发生时,等待锁的总时间。

cpu_latency:表示当前线程在CPU上花费的时间。

rows_sent:表示该用户语句事件发生时返回的总行数。

rows_examined:表示该用户语句事件发生时从存储引擎中读取的总行数。

rows_affected:表示该用户语句事件发生时影响的总行数。

full_scans:表示该用户语句事件发生时进行的全表扫描的总次数。

相关推荐
辛一一1 小时前
neo4j图数据库基本概念和向量使用
数据库·neo4j
巨龙之路2 小时前
什么是时序数据库?
数据库·时序数据库
蔡蓝2 小时前
binlog日志以及MySQL的数据同步
数据库·mysql
是店小二呀3 小时前
【金仓数据库征文】金融行业中的国产化数据库替代应用实践
数据库·金融·数据库平替用金仓·金仓数据库2025征文
炒空心菜菜3 小时前
SparkSQL 连接 MySQL 并添加新数据:实战指南
大数据·开发语言·数据库·后端·mysql·spark
专注于大数据技术栈3 小时前
Mac上安装Mysql的详细步骤及配置
mysql
多多*3 小时前
算法竞赛相关 Java 二分模版
java·开发语言·数据结构·数据库·sql·算法·oracle
爱喝酸奶的桃酥3 小时前
MYSQL数据库集群高可用和数据监控平台
java·数据库·mysql
进击的CJR4 小时前
MySQL 8.0 OCP 英文题库解析(四)
mysql