MySQL 8.0 OCP 1Z0-908 101-110题

Q101.which two queries are examples of successful SQL injection attacks?

A.SELECT id, name FROM backup_before WHERE name='; DROP TABLE injection; --';

B. SELECT id, name FROM user WHERE id=23 oR id=32 OR 1=1;

C. SELECT id, name FROM user WHERE user.id= (SELECT members.id FROM members);

D.SELECT email, passwd FROM members

WHERE email= 'INSERT INTO members ('email', 'passwd') VALUES

('bob@example.com', 'secret');--';

E. SELECT user,passwd FROM members WHERE user='?';INSERT INTO members ('user',"passwd') VALUES ("bob@example.com', 'secret');--';

F. SELECT id, name FROM user WHERE id=23 oR id=32 AND 1=1;

Answer:BE

bash 复制代码
SQL注入我不懂
参考:https://blog.csdn.net/DBA_ChenJR/article/details/147816607

Q102.You must run multiple instances of MySQL Server on a single host.Which three methods are supported?

A)Use system tools to lock each instance to its own CPU.

B)Run MySQL Server docker containers.

C)Use systemd with different settings for each instance.

D)Start mysqld or mysqld safe using different option files for each instance.

E)Run mysqld with --datadir defined for each instance.

F)Use resource groups to lock different instances on separate CPUs.

Answer:CDE

Q103.Which statement enables all roles granted to all users automatically?

A) SET ROLE ALL;

B) SET DEFAULT ROLE ALL TO '*'@'1'%';

C) SET PERSIST activate_all_roles_on_login=ON;

D) SET PERSIET mandatory_roles=ALL;

Answer:C

bash 复制代码
将 activate_all_roles_on_login 系统变量默认值为OFF,若设置为ON,服务器在登录时将激活授予每个账户的角色。

Q104.Which two situations will cause the binary log to rotate?

A)FLUSH HOSTS executed

B)max_binlog_size exceeded

C)max_binlog_cache_size exceeded

D)SET sql_log_bin=1 executed

E)SET sync_binlog=1 executed

F)FLUSH LOGS executed

Answer:BF

bash 复制代码
选项A:FLUSH HOST语句用于清除主机缓存表,以便重新加载主机名和IP地址的映射。
选项B:max_binlog_size表示binlog的最大文件大小,日志写入超过这个参数的设置的大小后,会关闭这个文件,然后重新创建一个新的binlog写入,进行轮转
选项C:max_binlog_cache_size 是一个 MySQL 系统变量,用于限制二进制日志(binlog)缓存的大小。,这个超出了会报错
选项D:sql_log_bin参数控制在当前会话中是否写binlog
选项E:sync_binlog控制binlog刷写到磁盘的方式,比如sync_binlog=0,不将日志写入磁盘,根据操作系统走,sync_binlog=1,每次提交都刷写到磁盘,sync_binlog=N,N次提交刷写到磁盘
F:FLUSH LOGS会新建一个日志,进行轮转

Q105.Examine this statement, which executes successfully:

CREATE TABLE world.city (

ID int NOT NULL AUTO_INCREMENT,

Name char (35) NOT NULL DEFAULT '',

CountryCode char (3) NOT NULL DEFAULT '',

District char (20) NOT NULL DEFAULT '',

Population int NOT NULL DEFAULT '0',

PRIMARY KEY (ID),

KEY (CountryCode (CountryCode)) ENGINE InnoDB;

SELECT Name

FROM world. city

WHERE Population BETWEEN 1000000 AND 2000000;

Which change enables the query to succeed while accessing fewer rows?

A)ALTER TABLE world.city ADD INDEX (Name) ;

B)ALTER TABLE world.city ADD SPATIAL INDEX (Name);

C)ALTER TABLE world.city ADD FULLTEXT INDEX (Name);

D)ALTER TABLE world.city ADD SPATIAL INDEX (Population);

E)ALTER TABLE world.city ADD INDEX (Population);

F)ALTER TABLE world.city ADD FULLTEXT INDEX (Population);

Answer:E

bash 复制代码
选项ABC,跟本次查询没有关系,并且population为int类型,所以就普通的二级索引就可以,没必要使用空间索引和全文索引

Q106.Examine this configuration:

You have a corporate private network, which uses its own Certificate Authority (CA) using an industry standard

2048-bit RSA key length.

 All MySQL Server and client certificates are signed using the central corporate CA.

 All clients are known, controlled,and exist only on the private LAN.

 The private network uses its own private authoritative DNS.

 The private network also uses other nominal enterprise services.

 An end-to-end encrypted connection for a MySQL client to MySQL server has been established on this LAN.

How does the MySQL Servers' self signed certificate compare to one that would be signed by a known public,third party trusted Certificate Authority?

A)The self-signed certificate is equally secure and equally trusted.

B)The self-signed certificate is more secure and less trusted.

C)The self-signed certificate is less secure and equally trusted.

D)The self-signed certificate is equally secure and less trusted.

E)The self -signed certificate is more secure and equally trusted.

F)The self-signed certificate is less secure and less trusted

Answer:F

bash 复制代码
自签证书的安全性和信任度较低

Q107.Which two are valid uses for binary logs on a MySQL instance?

A)logging the duration and locks for all queries //记录日志期间不产生锁

B)replication

C)audit of all queries

D)point-in-time recovery

E)recording the order in which queries are issued

Answer:BD

bash 复制代码
选项A:不记录SELECT和锁信息
选项B:复制期间是需要binlog的
选项C:查询的审计记录在审计日志,跟binlog没关系
选项D:基于时间点的恢复,是需要binlog支撑的
选项E:参考选项A

Q108.Which two are characteristics of snapshot based backups?

A)There is no need for InnoDB tables to perform its own recovery when restoring from the snapshot

backup.

B)Snapshot backups can be used only in virtual machines.

C)Snapshot based backups greatly reduce time during which the database and applications are unavailable.

D)The frozen file system can be cloned to another virtual machine immediately into active service.

E)A separate physical copy must be made before releasing the snapshot backup

Answer:AC

bash 复制代码
选项A:快照恢复完成后,启动时会自己进行Crash Recovery
选项C:快照备份会减少数据库和应用的不可用时间

Q109.Examine this output:

You plan to add this parameter to the configuration:

innodb_ directories=' /innodb_ extras '

Which statement is true?

A)It defines all innodb tablespace options relative to a starting parent directory.

B)It adds more temporary workspace in addition to the innodb_ tmpdir location.

c)It moves all innodb tablespaces to the 1 innodb_ extras directory to enable a new

innodb_ data_ home_ dir to be defined.

D)It is not necessary because innodb data_ home_ dir is already defined.

E)It allows scanning of other locations to discover more innodb tablespaces .

Answer:E

bash 复制代码
innoDB_directories变量,它定义了在启动时扫描以查找表空间文件的目录。

innodb_directories默认设置为NULL,但当innodb构建启动时要扫描的目录列表时,innodb_data_home_dir、innodb_undo_directory和datadir定义的目录总是附加到innodb_directories参数值之后。

无论是否显式指定了innodb_directories设置,都会附加这些目录。
使用绝对路径定义的表空间文件或位于附加到innodb_directories设置的目录之外的表空间应添加到innodd_directories设置中。

参考:
https://dev.mysql.com/doc/refman/8.0/en/innodb-moving-data-files-offline.html
https://blog.csdn.net/qq_29519041/article/details/139078303

Q110.Examine this command, which executes successfully:

mysqldump --user=root --password > full_ backup.sql

Which two databases will be excluded from this dump?

A)world

B)employee

C)information schema

D)mysql

E)sys

Answer:CE

bash 复制代码
参考:https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html
相关推荐
真上帝的左手2 小时前
4. 关系型数据库-MySQL-原生集成 AI能力
数据库·人工智能·mysql·ai
琳少_2 小时前
java课堂笔记
java·开发语言·数据库·笔记
3095566663 小时前
股票接口日期参数为什么不起作用:五组请求对照与逐字节比对排查笔记
服务器·数据库·笔记·python·量化·api接口·股票接口
计算机–阿拉升学长4 小时前
基于SpringBoot的番茄种植水肥一体化管理系统 — 系统设计与实现
java·spring boot·后端·mysql·vue·javaweb
计算机毕设定制辅导-无忧学长4 小时前
《基于SpringBoot的肩周炎健康管理系统设计与实现》
java·vue.js·spring boot·mysql·肩周炎健康管理系统
Decay__5 小时前
PostgreSQL 高可用与容灾架构 —— 流复制、Patroni、Keepalived+VIP、读写分离与两地三中心
运维·数据库·sql·postgresql
梅雅达编程笔记5 小时前
开发机能跑,服务器上跑不起来:MYD 考试系统配置设计与上线清单
mysql·nginx·flask·gunicorn·毕设项目·部署上线
Escalating_xu14 小时前
【MySQL】事务管理(上):从 ACID 到提交回滚,把一次转账真正做完整
android·数据库·mysql
不喝水就会渴16 小时前
「不想上班」实战系列:密码卡证保险箱 —— 主密钥存入 Asset,密文落库 RDB【鸿蒙心迹】
数据库·oracle
西泽XIZ917 小时前
微信小程序网络与数据库交互实践:从后端环境搭建到数据渲染
网络·数据库·微信小程序·小程序