MySQL 8.0 OCP 1Z0-908 131-140题

Q131.You have upgraded the MySQL binaries from 5.7.28 to 8.0.18 by using an in-place upgrade.

Examine the message sequence generated during the first start of MySQL 8.0.18:

。。。[System]。。。/usx/sbin/mysqld (mysqld 8.0.18-commercial) starting as process 2754

。。。[System]。。。Starting upgrade of data directory. .

。。。[ERROR]。。。。Table upgrade required. Please do ''REPAIR TABLE 'columns_ priv'" or dump/reload to

fix it!

。。。[ERROR]。。。Table upgrade required. Please do "REPAIR TABLE 'event'" or dump/reload to fix it!

。。。[ERROR]。。。Table upgrade required. Please do "REPAIR TABLE 'proc'" or dump/reload to fix it!

。。。[ERROR]。。。Table upgrade required. Please do "REPAIR TABLE 'proxies_ priv'" or dump/reload to fix

it!

。。。[ERROR]。。。Table upgrade required. Please do "REPAIR TABLE 'tables_ priv'" or dump/reload to fix it!

。。。[ERROR]。。。Failed to open mysql.event Table.

。。。[ERROR]。。。Failed to open mysql.proc Table.

。。。(ERROR]。。。Failed to Populate DD tables.

。。。[ERROR]。。。Aborting

。。。[System] 。。。 /usr/sbin/mysqld: shutdown complete (mysqld 8.0.18-commercial) MySQL Enterprise

Server - Commercial.

Which step or set of steps will resolve the errors?

A)Start mysqld again using the --upgrade=FORCE option.

B)Go to the /mysql directory and execute: myisamchk --update-state columns_ priv event proc

proxies_ priv tables_ priv.

C)Execute: mysqlcheck --repair mysql columns_ priv event proc proxies_ priv tables_ priv.

D)Remove the redo logs. Replace the MySQL binaries with the 5.7.28 binaries. Prepare the tables for upgrade.

Upgrade to 8.0.18 again.

E)Execute: mysqlcheck --check-upgrade mysql columns_priv event proc proxies_priv tables_ priv.

Answer:A

dd table是data dictionary

bash 复制代码
选项A:使mysql_upgrade已经在当前mysql版本上执行过,也忽略mysql_upgrade_info文件并强制执行mysql_upgrade
mysqlcheck只能检查和修复表中的是否违反唯一约束等这类问题,然后进行修复,故BCD都似乎错误的,E选项--check-upgrade只是检查一些权限,无法达到修复的目的

Q132.You plan to upgrade your MySQL 5.7 instance to version 8.

You have installed the 8 build of MySQL Shell.

Examine this command executed from the operating system shell prompt:

mysqlsh --uri root@localhost:3306 --util checkforserverupgrade

Which statement is true?

A)It documents any problems with your 5.7 tables to make them ready to upgrade to 8.

B)It fails because the operation name must be in camelCase.

C)It fixes any problems with your 5.7 tables to make them ready to upgrade to 8.

D)It is mandatory to clear the history of prior results before executing this process a second time or later.

E)It fails because checkForServerUpgrade must be executed only within an active shell session as a method of

the util object.

F)It is mandatory to run this command so that MySQL 8.0 software's auto-upgrade process has the details it

needs to operate properly.

Answer:A

bash 复制代码
mysqlsh --uri root@localhost:3306 --util checkforserverupgrade可以检查从5.7到8升级过程中出现的不兼容,已弃用的特性等信息

选项A:会记录5.7升级到8.0会出问题的表,是正确的
选项B:选项大小写无所谓,更不用什么驼峰命名
选项C:只检查不修复
选项D:每一次执行都会有产生自己的信息,没必要清理之前执行后产生的结果
选项E:命令行也行
选项F:mandatory:必须,强制,该命令也不一定必须执行,只要有足够的信息,没有什么兼容性的问题,那就可以不执行

Q133.Database test contains a table named city that has the InnoDB storage engine.

CREATE TABLE 'city' (

'ID' int NOT NULL AUTO_ INCREMENT,

'Name' char(35) NOT NULL DEFAULT '',

'Countrycode' char(3) NOT NULI DEFAULT '',

'District' char (20) NOT NULI DEFAULT ' ',

'Population' int NOT NULI DEFAULT '0',

PRIMARY KEY('ID'),

KEY 'CountryCode' (

' Countrycode' )

) ENGINE= InnoDB TABLESPACE=innodb_file_per_table;

What is the content of the test folder in the data directory?

A)city.MYD, city.MYI, and city.sdi

B)city.ibd

C)city. ibd and city.sdi

D)city. ibd and city. frm

E)city.ibd, city.frm, and city.sdi

Answer:B

bash 复制代码
frm:是描述表结构的文件。在8.0之前包含MySQL表的元数据,例如表定义。元数据是关于数据的数据,表定义则包含了表的结构信息,像表中有多少列、每列的数据类型、列的名称等,在8.0之后,这些信息存储在数据字典表中
MYD:存储myIsam数据的文件
MYI:存储myIsam数据表的索引信息
ibd:包含innodb的表数据和索引文件
sdi:序列化数据目录信息(SDI),SDI是表和表空间对象的序列化元数据。,存储了innodb表的元数据,在表空间中存储
以上表中是innodb表,所以会有ibd文件,sdi存储在表空间中,所以在test数据库路径下看不到

Q134.Which two MySQL Shell commands are excluded from the InnoDB Cluster creation procedure?

A)cluster.addInstance()

B)dba.configureLocalInstance()

C)dba.checkInstanceConfiguration()

D)cluster.setPrimaryInstance()

E)dba.configureInstance 0)

F)dba.createCluster()

G)cluster.forceQuorumUsingPartitionOf()

Answer:DG

bash 复制代码
选项A:此命令用于将新实例添加到已创建的集群中,是集群创建和管理过程的一部分
选项B:此命令用于配置本地实例以加入集群,通常在创建集群之前或过程中使用
选项C:此命令用于检查实例是否适合加入集群,通常在创建集群之前使用。
选项D:此命令用于设置或更改集群的主实例,通常在集群创建之后用于管理集群,而不是集群创建过程的一部分
选项E:此命令用于配置实例以确保其适合加入集群,通常在创建集群之前使用。
选项F:此命令用于实际创建 InnoDB Cluster,是集群创建过程的核心步骤
选项G:此命令用于在网络分区或故障情况下强制设置仲裁,以恢复集群的正常运行,不属于常规的集群创建过程。

Q135.Which four connection methods can MySQL clients specify with the --protocol option when connecting to a

MySQL server?

A)IPv4

B)SOCKET

C)MEMORY

D)PIPE

E)IPv6

F)FILEO

G)TCP

H)DIRECT

Answer:BCDG

Q136.Which two authentication plugins require the plaintext client plugin for authentication to work?

A)LDAP authentication

B)SHA256 authentication

C)Windows Native authentication

D)PAM authentication

E)MySQL Native Password

F)LDAP SASL authentication

Answer:AD

bash 复制代码
Hashing or encryption cannot be done for authentication schemes that require the server to receive the password as entered on the client side. In such cases, the client-side mysql_clear_password plugin is used, which enables the client to send the password to the server as cleartext. There is no corresponding server-side plugin. Rather, mysql_clear_password can be used on the client side in concert with any server-side plugin that needs a cleartext password. (Examples are the PAM and simple LDAP authentication plugins; see Section 8.4.1.5, "PAM Pluggable Authentication", and Section 8.4.1.7, "LDAP Pluggable Authentication".)

对于那些需要服务器以客户端输入的形式接收密码的身份验证方案,无法进行哈希或加密。在这种情况下,客户端会使用mysql_clear_password插件,该插件允许客户端将密码以明文形式发送给服务器。没有对应的服务器端插件。相反,mysql_clear_password可以在客户端与任何需要明文密码的服务器端插件配合使用(例如PAM可插拔身份验证插件和简单的LDAP身份验证插件;

参考:https://dev.mysql.com/doc/refman/8.4/en/cleartext-pluggable-authentication.html

Q137.Where is the default data directory located after installing MySQL using RPM on Oracle Linux 7?

A)/usr

B)/usr/mysql

C)/etc/my.cnf

D)/var/lib/mysql

E)/usr/bin

Answer:D

Q138.You must store connection parameters for connecting a Linux-based MySQL client to a remote Windows-based MySQL server listening on port 3309.

Which four methods can be used to configure user, host, and database parameters?

A) Execute the command in a bash script.

B) Embed login information into the SSH tunnel definition.

C) Define a UNIX socket.

D) Execute mysql_config_editor to configure the user connection.

E) Configure~/.ssh/config for public key authentication.

F) Use the usermod program to store static user information.

G) Execute the mysqladmin command to confiaure the user connection.

H) Configure~/.my.cnf.

  1. Configure environment variables
    Answer:ADHI
bash 复制代码
可以使用bash脚本,mysql_config_editor工具,环境变量,或者配置在~/.my.cnf存储连接用户的名称,ip数据库等连接信息

Q139.You plan to install MySQL Server by using the RPM download.

Which two statements are true?

A)You must manually initialize the data directory.

B)You can provide the root password interactively.

C)The MySQL RPM package installation supports deploying multiple MySQL versions on the same host.

D)MySQL uses the RPM relocatable installation target feature.

E)You can find the root password in the error log after the first start.

F)The functionality is split among several RPM package files.

Answer:EF

bash 复制代码
RPM安装步骤:
1.下载RPM安装包
2.查看安装包:$> rpm -qpl mysql-community-server-version-distribution-arch.rpm
3.安装:$> sudo yum install mysql-community-{server,client,client-plugins,icu-data-files,common,libs}-*
4.启动:$> systemctl start mysqld
5.查看临时密码:$> sudo grep 'temporary password' /var/log/mysqld.log

从这个过程中可以看到,
选项A:不需要手动创建data路径
选项B:也不需要交互式的提供密码
选项C:RPM不支持单机多实例,因为需要不同的实例间需要不同的配置
选项D:RPM安装都是默认位置,也没有重新定位 安装目标路径
选项E:在error log中查看密码是正确的
选项F:功能分布在多个 RPM 软件包文件中。也是正确的,可以看到安装的时候需要安装不同的包

Q140.Examine this MySQL Shell command:

dba.rebootClusterFromCompleteOutage ()

Which two statements are true? (Choose two.)

A)It reconfigures InnoDB Cluster if the cluster was stopped.

B)It performs InnoDB Cluster instances rolling restart.

C)It only starts all InnoDB Cluster instances.

D)It is not mandatory that all instances are running and reachable before running the command.

E)It stops and restarts all InnoDB Cluster instances and initializes the metadata.

F)It only stops and restarts all InnoDB Cluster instances.

G)It picks the minimum number of instances necessary to rebuild the quorum and reconfigures InnoDB Cluster.

Answer:AD

bash 复制代码
rebootClusterFromCompleteOutage()是MySQL Shell中的一个实用命令,用于在 InnoDB 集群遇到完全中断 (例如,当组复制在所有成员实例上停止时)后重新配置和恢复集群。这个命令允许你连接到集群中的一个 MySQL 实例,并使用该实例的元数据来恢复整个集群。

选项A:正确
选项D:可以在某一个实例上运行该命令,所以不需要强制所有实例都是running状态和可达的
相关推荐
_星辰大海乀18 分钟前
表的设计、聚合函数
java·数据结构·数据库·sql·mysql·数据库开发
未来之窗软件服务1 小时前
solidwors插件 开发————仙盟创梦IDE
前端·javascript·数据库·ide·仙盟创梦ide
yc_12241 小时前
SqlHelper 实现类,支持多数据库,提供异步操作、自动重试、事务、存储过程、分页、缓存等功能。
数据库·c#
Leo.yuan2 小时前
基于地图的数据可视化:解锁地理数据的真正价值
大数据·数据库·信息可视化·数据挖掘·数据分析
好吃的肘子2 小时前
MongoDB入门
数据库·mongodb
noravinsc2 小时前
人大金仓数据库 与django结合
数据库·python·django
代码配咖啡3 小时前
《Navicat之外的新选择:实测支持国产数据库的SQLynx核心功能解析》
数据库
懒大王爱吃狼3 小时前
怎么使用python进行PostgreSQL 数据库连接?
数据库·python·postgresql
时序数据说3 小时前
IoTDB集群的一键启停功能详解
大数据·数据库·开源·时序数据库·iotdb
小叶子来了啊4 小时前
信息系统运行管理员:临阵磨枪版
运维·服务器·数据库