Udemy- Test #4 Q's Flashcards

1
Q

You have forgotten the root user account password. You decide to reset the password and execute the following:

Shell> /etc/init.d/mysql stop

Shell> /etc/init.d/mysql start –skip-grant tables

Which additional argument makes this operation safer?

A. –read-only, to set all data to read-only except for super users

B. –old-passwords, to start MySQL to use the old password format while running without the grant tables

c. –skip-networking, to prohibit access from remote locations

A

c. –skip-networking, to prohibit access from remote locations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

You started your server with the parameter: –skip-grant-tables

/usr/local/mysql/bin/mysqld –user=_mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data –skip-grant-tables

Who will have access to the server?

A. Only root

B. All users

A

B. All users

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which two methods will show the count of partitions for the Country table? (Choose two.)

A. SHOW CREATE TABLE COUNTRY;

B. SELECT * FROM information_schema.PARTITIONS WHERE TABLE_NAME=’COUNTRY’;

C. SELECT * FROM performance_schema.PARTITIONS WHERE TABLE_NAME=’COUNTRY’;

D. SHOW STATUS TABLE COUNTRY;

A

A. SHOW CREATE TABLE COUNTRY;

B. SELECT * FROM information_schema.PARTITIONS WHERE TABLE_NAME=’COUNTRY’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Consider two tables that are equally defined, except for the partitioning method, and have two million records in each table.

The following query is executed and takes 2 minutes and 38 seconds to complete.

ALTER TABLE orders_hash ADD PARTITION p6;

You then execute the following query, which takes 13 seconds to complete;

ALTER TABLE orders_linear_key ADD PARTITION p6;

What could explain the difference in completion time?

A. The HASH algorithm is computationally harder than the LINEAR KEY algorithm.

B. The LINEAR KEY method changes fewer partitions

C. The HASH algorithm requires a file sort of the index before updating.

A

B. The LINEAR KEY method changes fewer partitions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which two statement are true about the mysql upgrade command?

A. The mysql_upgade command is a utility that patches the mysql binary from its base version to a new version

B. The mysql upgrade command is run to check and attempt to fix tables for certain incompatibilities with the current version of MySQL

C. The mysql upgrade command executes on a stopped MySQL server data directory to ensure that it is prepared for upgrades.

D. The mysql upgrade command also executes the mysqlcheck command in order to provide all of its functionality.

A

B. The mysql upgrade command is run to check and attempt to fix tables for certain incompatibilities with the current version of MySQL

D. The mysql upgrade command also executes the mysqlcheck command in order to provide all of its functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does the InnoDB storage engine handle deadlocks when they are detected? (Choose one.)

A. The affected transaction wait for innodb_lock_wait_timeout seconds, and then roll back.

B. The transaction isolation level determines which transaction is rolled back.

C. One of the affected transactions will be rolled backed, the other is allowed to proceed.

D. Both the affected transactions will be rolled back.

E. The innodb_locks_unsafe_for_binlog setting determines which transaction is rolled back.

A

C. One of the affected transactions will be rolled backed, the other is allowed to proceed.

Explanation
When deadlock detection is enabled (the default) and a deadlock does occur, InnoDB detects the condition and rolls back one of the transactions (the victim). If deadlock detection is disabled using the innodb_deadlock_detect configuration option, InnoDB relies on the innodb_lock_wait_timeout setting to roll back transactions in case of a deadlock.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

You want to lock the three MYISAM tables a,b and c.

You issue the following statements:

Mysql> LOCK TABLES a READ;
Mysql> LOCK TABLES b READ;
Mysql> LOCK TABLES c READ;

What is the result? (Choose one)

A. Table a, b, c are all locked.

B. Only the lock on table a takes effect.

C. Only the lock on table c takes effect.

D. None of the tables are locked.

A

C. Only the lock on table c takes effect.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why should you be selective when granting the PROCESS privilege to an account?

A. It allows a client to process scripts.

B. It allows the use of stored routines.

C. It allows a client to see another user’s queries with the SHOW PROCESSLIST command.

D. It allows a client to control running processes on a server.

A

C. It allows a client to see another user’s queries with the SHOW PROCESSLIST command.

Explanation
The PROCESS privilege controls access to information about threads executing within the server (that is, information about statements being executed by sessions).

Thread information available using the SHOW PROCESSLIST statement, the mysqladmin processlist command, the INFORMATION_SCHEMA.PROCESSLIST table, and the Performance Schema processlist table is accessible as follows:

With the PROCESS privilege, a user has access to information about all threads, even those belonging to other users.

Without the PROCESS privilege, nonanonymous users have access to information about their own threads but not threads for other users, and anonymous users have no access to thread information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

You want to dump only data from the userdata table.

Which mysqldump command argument is required to accomplish this?

A. –no-create-info to skip writing CREATE TABLE statements

B. –single-transaction as this obtains a consistent view of data only

C. –data-only as this specifies that only data is to be dumped

D. –table=userdata in order to dump only the data from the userdata table

A

A. –no-create-info to skip writing CREATE TABLE statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

You need to dump the data from the master server and import it into a new slave server.

Which mysqldump option can be used when dumping data from the master server in order to include the master server’s binary log information?

A. include-log-file

B. master-binlog

C. master-data

A

C. master-data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

While attempting to set up a new replication slave on host ‘192.168.0.25’ with the user ‘replication’, you encounter this error:

ERROR 1218 (08S01): error connecting to master: Host ‘192.168.0.25’ is not allowed to connect to this MySQL server.

What should you do to resolve this error?

A. Add the user replication@192.168.0.25 with the correct password to the master.

B. Edit the DNS table on the master to include the domain name for the IP address of 192.168.0.25

C. Edit the my.ini file on the slave so that the master-host variable is equal to the IP address of the master, and restart the slave.

D. Add the user replication@192.168.0.25 with the correct password to the slave.

A

A. Add the user replication@192.168.0.25 with the correct password to the master.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which two capabilities are granted with the SUPER privilege?

A. allowing change of the server runtime configuration

B. allowing a client to shut down the server

C. allowing client accounts to take over the account of another user

D. allowing a client to kill other client connections

A

A. allowing change of the server runtime configuration

D. allowing a client to kill other client connections

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

You are remotely logged in to MySQL as the user “backup”.

The account has temporarily been granted full privileges WITH GRANT to perform the actions required. You want to change the password for the locally existing “backup” user.

Select the three commands which will perform the required action. (Choose three.)

A. SET PASSWORD FOR ‘backup’@’localhost’=’password’;

B. SET PASSWORD =’password’;

C. SET PASSWORD FOR ‘backup’@’localhost’= PASSWORD (‘password’);

D. ALTER USER USER() INDENTIFIED BY ‘password’;

E. CREATE USER ‘backup’@’localhost’ IDENTIFIED BY ‘password’;

F. ALTER USER ‘backup’ IDENTIFIED BY ‘password’;

G. ALTER USER ‘backup’@’localhost’ IDENTIFIED BY ‘password’;

A

A. SET PASSWORD FOR ‘backup’@’localhost’=’password’;

D. ALTER USER USER() INDENTIFIED BY ‘password’;

G. ALTER USER ‘backup’@’localhost’ IDENTIFIED BY ‘password’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Multiversion Concurrency Control (MVCC) enables what type of backup?

A. hot

B. binary

C. logical

D. incremental

A

A. hot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Consider:
mysql> EXPLAIN SELECT Name from Country WHERE Population BETWEEN 1 AND 100\G

****** 1. Row ******
id: 1
Select type: SIMPLE
table: Country
type: range
possible_keys: i_pop
key: i_pop
key_len: 4
ref: NULL
rows: 10
Extra: Using where

What does the range value in the type column mean?

A. You can use an index and return rows that fall within a range of values.

B. The table will be scanned over a certain range of values.

C. This type of index uses the range hash.

D. There is a range of indexes that can be used.

A

A. You can use an index and return rows that fall within a range of values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which MySQL utility copies the master instance to a slave instance on the same host?

A. mysqlfallover

B. mysqldbcopy

C. mysqlrplsync

D. mysqlserverclone

A

D. mysqlserverclone

Explanation
This utility enables you to clone an existing MySQL server instance to create a new server instance on the same host.

The utility does not copy any data. It merely creates a new running instance of the cloned server with the same options (or additional options if specified). Thus, to create a copy of a server, you must copy the data after the server is cloned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which statement is true about tablespaces?

A. All tablespace files must be in the directory specified by the –datadir option.

B. General tablespaces can be configured to span multiple files.

C. All tables must be in either the system tablespace or a general tablespace.

D. The system tablespace can be configured to span multiple files.

A

D. The system tablespace can be configured to span multiple files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Which statement is correct about how InnoDB storage engine uses disk space?

A. It stores data in .MYD files and its index and undo information in the common tablespace.

B. It stores data in the .MYD files, index information in the .MYI files, and undo information in the common tablespace.

C. It stores its data in the tablespace file(s). Index and data dictionary details are stored in .FRM files.

D. It stores its data, index and undo information in the .MYD and .MYI files.

E. It stores data, index and undo information in the tablespace files(s).

A

E. It stores data, index and undo information in the tablespace files(s).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which two methods will provide the total number of partitions on a table? (Choose two.)

A. Query the INFORMATION_SCHEMA.PARTITIONS table

B. Use the command: SHOW TABLE STATUS

C. Query the INFORMATION_SCHEMA.TABLES tables for the partition_count.

D. Query the performance_schema.objects_summary_global_by_type

E. Use the command: SHOW CREATE TABLE

A

A. Query the INFORMATION_SCHEMA.PARTITIONS table

E. Use the command: SHOW CREATE TABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Where does MySQL Linux RPM install the mysqld binary?

A. /usr/libexec/

B. /usr/local.mysql/bin/

C. /usr/sbin/

D. /usr/bin/

E. /opt/mysql/server/bin/

A

C. /usr/sbin/

Default locations
client programs and scripts = /usr/bin
mysqld server = usr/sbin
data directory = /var/lib/mysql
error log file =  /var/log/mysql/error.log (linux) \ProgramData\MySQL\MySQL Server 8.0\Data\filename.err (windows)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

You are investigating the performance of the server and see this information: events_waits_summary_global_by_event_name in the Performance Schema shows that the wait/synch/mutex/sql/LOCK_table_cache event is dominating other wait events. The Table_open_cache_overflows status variable is 0.

Which action should be taken to remove the performance bottleneck described here?

A. Increase the value of table_open_cache_instances.

B. Decrease the value of table_definition_cache.

C. Decrease the value of table_open_cache.

D. Increase the value of table_definitnion_cache.

E. Increase the value of table_open_cache.

A

A. Increase the value of table_open_cache_instances.

Explanation
To improve scalability by reducing contention among sessions, the open tables cache can be partitioned into several smaller cache instances of size table_open_cache / table_open_cache_instances .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

You have successfully provisioned the latest MySQL 8.0 database instance on a physical host, to be added to an existing farm for use in a modern, high volume, ACID-compliant, OLTP website, which serves hundreds of DML transactions per second.

The default values of which two key variables do you change to ensure seamless operation of the database? (Choose two.)

A. Key Buffer Size

B. InnoDB Redo Log Size

C. Binary Log Size

D. Buffer Pool Size

E. Sort Buffer size

F. Query Cache size

A

D. Buffer Pool Size

E. Sort Buffer size

cbryll aug/2021 - seems odd that soft buffer size is the answer.
# Sort buffer is used to perform sorts for some ORDER BY and GROUP BY
# queries. If sorted data does not fit into the sort buffer, a disk
# based merge sort is used instead - See the "Sort_merge_passes"
# status variable. Allocated per thread if sort is needed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

You are creating a strategy for backing up MySQL using a cold binary backup. The MySQL instance is a replication master with global transaction identifiers (GTIDs) enabled and it uses Transparent Data Encryption (TDE). Other than the configuration required to make the instance a replication master and enabled GTIDs and TDE, the instance is using all default settings.

The requirements for the backup are:

It must be possible to rebuild the instance using the backup.

It must be verified.

It must allow for a catastrophic hardware failure.

Which four steps must be included in the backup strategy? (Choose two.)

A. Include the keyring data and/or configuration in the backup.

B. Restore the backup to a clean MySQL instance.

C. Copy the backup to a remote host.

D. Include the MySQL socket file in the backup.

A

A. Include the keyring data and/or configuration in the backup.

B. Restore the backup to a clean MySQL instance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

You are creating a strategy for backing up MySQL using a cold binary backup. The MySQL instance is a replication master with global transaction identifiers (GTIDs) enabled and it uses Transparent Data Encryption (TDE). Other than the configuration required to make the instance a replication master and enabled GTIDs and TDE, the instance is using all default settings.

The requirements for the backup are:

It must be possible to rebuild the instance using the backup.

It must be verified.

It must allow for a catastrophic hardware failure.

Which four steps must be included in the backup strategy? (Choose two.)

A. Include the ibtmp1 file in he backup

B. Include the relay log in the backup.

C. Include the operating system disk encryption key in the backup.

D. Include the MySQL PID file in the backup.

E. Include the binary logs in the backup.

A

B. Include the relay log in the backup.

C. Include the operating system disk encryption key in the backup.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Which storage option for MySQL data directory typically offers the worst performance in a highly concurrent, OLTP-heavy, IO-bound workload?

A. battery-backed locally-attached RAID 5 array

B. ISCSI Lun

C. SAN (Fibre Channel) Lun

D. NFS (Network File System) mount

A

D. NFS (Network File System) mount

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Which two statements are true regarding MySQL security? (Choose two.)

A. The mysql user needs to have sudo priviledges.

B. The mysql process owner should own all files and directories to which the server writes.

C. The root or administrator users should own all files and directories to which tje server writes.

D. The mysql process should be run as a root or administrator

E. The mysql process should not be run as root or administrator.

A

B. The mysql process owner should own all files and directories to which the server writes.

E. The mysql process should not be run as root or administrator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

You have installed the validate_password plug-in and set the validate_password_policy variable. Which validation is affected by the validate_password_policy setting?

A. whether a new password is rejected if it contains a word found in a dictionary file.

B. whether a new password is rejected if it contains the current user’s username.

C. the amount of delay after an incorrect password is entered

D. the length of time before a newly created password expires.

A

A. whether a new password is rejected if it contains a word found in a dictionary file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Which statement describes how the relay log works?

A. when a slave receives a change from the master, it is processed first, and then recorded in the relay log.

B. It maintains a record of available master binary logs and the current executed log position.

C. It stores changes on the master, and relays them to the slave.

D. When a slave receive a change from the master, it is recorded in the relay log first and processed later.

A

D. When a slave receive a change from the master, it is recorded in the relay log first and processed later.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

The MySQL user ‘adam’ currently has USAGE permissions to the database.

The football database is transactional and has non-stop updates from application users. The ‘adam’ user needs to be able to take consistent backups of the football database by using the –single-transaction option.

Which extra GRANT permissions are required for adam to take mysqldump backups?

A. The ‘adam’ user must also have SINGLE TRANSACTION global grant to take a consistent backup.

B. The ‘adam’ user needs the PROCESS privilege to be able to take a consistent backup while other users are connected.

C. The ‘adam’ user must have the SUPER privilege in order to take data backups.

D. The ‘adam’ user must also have SELECT on the football databases for the backup to work.

A

D. The ‘adam’ user must also have SELECT on the football databases for the backup to work.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

You have forgotten the root user account password. You decide to reset the password and execute:

shell > /etc/init.d/mysql stop
shell > /etc/init.d/mysql start –skip-grant-tables

Which additional argument makes this operation safer?

A. –old-passwords, to start MySQL to use the old password format while running without the grants tables

B. –reset-grant-tables, to start the server with only the mysql database accessible.

C. –read-only, to set all data to read-only except for super users

D. –skip-networking, to prohibit access form remote locations

A

D. –skip-networking, to prohibit access form remote locations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

You are receiving complaints from your application administrators that they are seeing periodic stalls in database response (no queries to any table are returning results for several seconds or longer). You monitor your system and notice that the durations of those stalls correspond to peaks in disk I/O.

Which 2 things should you investigate?

A. Check the rate of change in the status value Aborted_connects and compare to the rate of change in Connections.

B. Check the difference between the InnoDB status values “Log Sequence number” and “Last Checkpoint” positions then compare that to the total size of the redo log.

C. Check the rate of change in the status value select_scan and compare to the rate of change in Com_select.

D. Check the difference between the InnoDB staus values “Trx id counterr” and “Purge done for” and compare to the state substatus of the main “Main thread”

E. Check the rate of change in the status value Qcache_hits and that to the rate of change of Qcache_not_cached.

A

B. Check the difference between the InnoDB status values “Log Sequence number” and “Last Checkpoint” positions then compare that to the total size of the redo log.

E. Check the rate of change in the status value Qcache_hits and that to the rate of change of Qcache_not_cached.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

You have created a backup of the ‘sales’ database with the command:

mysqldump -u root -p –tab=/backup sales

Which two procedures can be used to restore the ‘orders’ table from the backup?

A. shell$ mysqldump -u root -p –tab=/backup –restore sales –tables orders

B. shell$ mysql -u root -p sales < /backup/orders.sql
shell$ mysql -u root -p sales < /backup/orders.txt

C. mysql> use sales;
mysql> source /backup/orders.sql;
mysql> load data local in file ‘/backup/orders.txt’ into table orders;

D. shell$ mysql -u root -p sales < /backup/orders.sql
shell$ mysqlimport -u root -p –local sales /backup/orders.txt

A

C. mysql> use sales;
mysql> source /backup/orders.sql;
mysql> load data local in file ‘/backup/orders.txt’ into table orders;

D. shell$ mysql -u root -p sales < /backup/orders.sql
shell$ mysqlimport -u root -p –local sales /backup/orders.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

A MySQL instance has this configuration values set:

– innodb-doublewrite=ON

–innodb-flush-log-at-trx-commit=1

–sync-binlog=1

A transaction involving a single InnoDB INSERT statement commits. Which list of locations is in the sequence of disk writes for this transaction?

A. binary log, redo log, doublewrite buffer, and tablespace.

B. redo log, binary log, doublewrite buffer, and tablespace.

C. doublewrite buffer, redo log, tablespace, and binary log

D. redo log, doublewrite buffer, tablespace, and binary log

A

A. binary log, redo log, doublewrite buffer, and tablespace.

34
Q

SQL injection is a common security threat.

Which two methods would help protect against this risk?

A. using stored procedures to validate values that are input

B. using SQL variables to secure input values

C. using prepared statements to handle unsecured values

D. installing the SQL Protection plugin to catch such attempts

E. starting the server with the -injection-protection command-line option.

A

A. using stored procedures to validate values that are input

C. using prepared statements to handle unsecured values

35
Q

You want to immediately stop access to a database server for remote user ‘mike’@’client.example.com’. This user is currently not connected to the server. Which two actions can you take to stop any access from the user?

A. Use ALTER USER ‘mike’@’client.example.com’ PASSWORD EXPIRE;

B. Use REVOKE ALL PRIVILEGES FROM ‘mike’@’client.example.com’;

C. Execute the mysql_secure_installation command

D. Use DROP USER ‘mike’@’client.example.com’;

E. Use GRANT USAGE ON . TO ‘mike’@’client.example.com’ MAX_USER_CONNECTIONS=0;

F. Use ALTER USER ‘mike’@’client.example.com’ ACCOUNT LOCK;

A

D. Use DROP USER ‘mike’@’client.example.com’;

F. Use ALTER USER ‘mike’@’client.example.com’ ACCOUNT LOCK;

36
Q

In which order does MySQL process an incoming INSERT statement?

A. It checks whether the user is authorized to perform the query, writes to the binary log, and then optimize it.

B. It checks whether the user is authorized to perform the query, optimize it, and then writes to the binary log.

C. It writes the query to the binary log, optimize it, and then checks whether the user is authorized to perform the query.

D. It optimizes the query, checks whether the user is authorized to perform it, and then writes to the binary log.

A

C. It writes the query to the binary log, optimize it, and then checks whether the user is authorized to perform the query.

37
Q

This output is from a SHOW SLAVE STATUS:


SQL_DELAY:360

What would cause the SQL_Delay variable to have a value of 360?

A. The aster has performed a large transaction, which will take 360 seconds to complete on the slave.

B. The network latency between the master and the slave is 360 milliseconds.

C. The slave will need an estimates 360 seconds to update the remaining contents from the relay log.

D. The slave was configured for delayed replication with a delay of six minutes.

A

D. The slave was configured for delayed replication with a delay of six minutes.

38
Q

You have a config file for a running DB with this excerpt:

[mysqld]
tmp_table_size=16M
sort_buffer_size=256k

To address a query performance problem of connecting to the DB from an application on another host, you log in and make these changes to the DB:

mysql> SET GLOBAL tmp_table_size=32000000;
mysql> SET sort_buffer_size=2000000;

This solves the problem with your queries. However, later the DB instance is restarted and the performance problem returns.

Which three best describe this scenario?

A. Global variables are not persistent across server restarts.

B. Session variables are not persistent across server restarts.

C. The query benefited from sort_buffer_size increase.

D. sort_buffer_size should match tmp_table_size to be optimal.

E. The query benefited from tmp_table_size increase.

A

A. Global variables are not persistent across server restarts.

B. Session variables are not persistent across server restarts.

C. The query benefited from sort_buffer_size increase.

39
Q

You have just created a replication slave from a backup of the master made with mysqldump:

mysqldump -u backup -p –all-databases > /backups/mysql.sql

You try to log in to the slave with the application user, but fail as follows:

mysql -u application -p
ERROR 1045 (28000): Access denied for user 'applicaton'@'localhost' (using password: YES)

The login works on the master.

Which two changes to the process can fix the issue?

A. After the restore, log in to the database and execute FLUSH PRIVILEGES.

B. Use the –flush-privileges with mysqldump.

C. Add a second dump for the ‘mysql’ database; –all-database does not include it.

D. Use the –grants option to include GRANT statements in the dump.

A

A. After the restore, log in to the database and execute FLUSH PRIVILEGES.

B. Use the –flush-privileges with mysqldump.

Explanation
Add a FLUSH PRIVILEGES statement to the dump output after dumping the mysql database. This option should be used any time the dump contains the mysql database and any other database that depends on the data in the mysql database for proper restoration.

Because the dump file contains a FLUSH PRIVILEGES statement, reloading the file requires privileges sufficient to execute that statement.

40
Q

Consider:

mysql> EXPLAIN SELECT * FROM City WHERE Name = ‘Jacksonville’ AND CountryCode = ‘USA’\G

***** 1. row *********
id: 1
select_type: SIMPLE
table: City
type: ref
possible_keys: name_country_index
key: name_country_index
key_len: 13
ref: const, const
rows: 1
Extra: Using where

Which statement best describes the meaning of the value for the key_len column?

A. It shows how many bytes will be used from each index row.

B. It shows the number of characters indexed in the key.

C. It shows the total size of the index row.

D. It shows how many columns in the index are examined.

A

A. It shows how many bytes will be used from each index row.

41
Q

What does the possible_keys column in this output denote?

mysql> EXPLAIN SELECT * FROM City WHERE CountryCode = ‘USA’\G

***** 1. row *********
id: 1
select_type: SIMPLE
table: City
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 4079
Extra: Using where

A. If it is possible for you to include any indexes in your query

B. whether there are any indexes on the table that you are querying

C. If there are any indexes that may be used to solve this query

D. whether you are using any indexes in your query

A

A. If it is possible for you to include any indexes in your query

42
Q

Consider the key buffer in a MySQL server. Which two statements are true about this feature? (Choose two.)

A. It caches index blocks for MyISAM tables only.

B. It caches index blocks for all storage engine tables.

C. It is global buffer.

D. It is set on a per-connection basis.

E. It caches index blocks for InnoDB tables only

A

A. It caches index blocks for MyISAM tables only.

C. It is global buffer.

Explanation
An index block is a contiguous unit of access to the MyISAM index files. Usually the size of an index block is equal to the size of nodes of the index B-tree. (Indexes are represented on disk using a B-tree data structure. Nodes at the bottom of the tree are leaf nodes. Nodes above the leaf nodes are nonleaf nodes.)

43
Q

You enable binary logging on MySQL Server with the configuration: binlog-format=STATEMENT log-bin Which database updates are logged on the master server to the binary log by default?

A. all updates expect to the TEMPDB database

B. all updates expect to the PERFORMANCE_SCHEMA database

C. all updates to the default database, except temporary tables

D. all updates to the default database, except temporary tables

E. all updates to all databases

A

E. all updates to all databases

44
Q

To satisfy a security requirement, you have created or altered some user accounts to include REQUIRE X509. Which additional task needs to be performed for those user accounts to fulfill the requirement to use X509?

A. Install the X509 plug-in on the server

B. Set the X509 option in the [client] section of the MySQL server’s configuration file.

C. Restart the server with the –require-x509 option

D. Distribute client digital certificates to the client computers being used to log in by the user accounts

E. Provide users access to the server’ private key

A

D. Distribute client digital certificates to the client computers being used to log in by the user accounts

Explanation
Indicates that all accounts named by the statement have no SSL or X.509 requirements. Unencrypted connections are permitted if the user name and password are valid. Encrypted connections can be used, at the client’s option, if the client has the proper certificate and key files.

45
Q

Which Program Copies The Databases From One Server To Another?

A. mysqldbcopy

B. mysqlcopydb

C. mysqlcopydbsync

A

A. mysqldbcopy

46
Q

The MySQL installation includes the mysql_config_editor utility for managing login paths stored in a .mylogin.cnf file.

Which is true about the login path feature?

A. mysql_config_editor is the only MySQL-provided utility that can print the values stored in.mylogin.cnf

B. A .ylogin.cnf file can store at most one login path.

C. It is an alternative to storing the MySQL login details in a my.cnf file

A

C. It is an alternative to storing the MySQL login details in a my.cnf file.

Explanation
. mysql_config_editor provides a print command for displaying the login path file contents, but even in this case, password values are masked so as never to appear in a way that other users can see them.

47
Q

The MySQL installation includes the mysql_config_editor utility for managing login paths stored in a .mylogin.cnf file.

Which is true about the login path feature?

A. It provides a FIPS-complaint keyring for storing MySQL login details.

B. A .mylogin.cnf file can be edited using a test editor, such as vim or Notepad++.

C. It provides means to help avoid accidentally exposing the MySQL login detail.

A

C. It provides means to help avoid accidentally exposing the MySQL login detail.

48
Q

Which MySQL utility program should you use to process and sort the Slow Query Log based on query time or average query time?

A. mysqldumpslow

B. mysqldump

C. mysqlaccess

D. mysqlshoq

E. mysqlslow

A

A. mysqldumpslow

49
Q

These details are shown when logged in to an account:

mysql> SELECT USER(), CURRENT_USER();
+——————————+——————————–+
| USER () | CURRENT_USER () |
+——————————+——————————–+
| robert@localhost | employee@localhost |
+——————————+——————————–+
mysql> SHOW GLOBAL VARIABLES LIKE ‘check_proxy_user’;
+——————————+——————————–+
| Variable_name | Value |
+——————————+——————————–+
| check_proxy_users | OFF |
+——————————+——————————–+

(this flashcard is missing part of the question)

A.
mysql> CREATE USER ‘’@’’ IDENTIFIED WITH
authentication_pam ACCOUNT_LOCK;
mysql> CREATE USER ‘employee’@’localhost’
IDENTIFIED BY ‘more_secrets’:
mysql> GRANT PROXY ON ‘employee’@’localhost’
TO ‘ ‘@’ ‘;

B.
mysql> CREATE USER ‘robert’@’localhost’
IDENTIFIED BY ‘secret_password’:
mysql> CREATE USER ‘employee’@’localhost’
IDENTIFIED BY ‘more_secrets’:

C.
mysql> CREATE USER ‘employee’@’localhost’
IDENTIFIED BY ‘more_secrets’:
mysql> CREATE USER ‘’@’’ IDENTIFIED BY
‘valid_password’ WITH PROXY
‘employee’@’localhost’ ;

A

A.
mysql> CREATE USER ‘’@’’ IDENTIFIED WITH
authentication_pam ACCOUNT_LOCK;
mysql> CREATE USER ‘employee’@’localhost’
IDENTIFIED BY ‘more_secrets’:
mysql> GRANT PROXY ON ‘employee’@’localhost’
TO ‘ ‘@’ ‘;

Explanation
The MySQL server authenticates client connections using authentication plugins. The plugin that authenticates a given connection may request that the connecting (external) user be treated as a different user for privilege-checking purposes. This enables the external user to be a proxy for the second user; that is, to assume the privileges of the second user:

The external user is a “proxy user” (a user who can impersonate or become known as another user).

The second user is a “proxied user” (a user whose identity and privileges can be assumed by a proxy user).

50
Q

Consider this statement on a RANGE-partitioned table:

mysql> ALTER TABLE orders DROP PARTITION p1, p3;

What is the outcome of executing this statement?

A. All data in p1 and p3 partitions is removed and the table definition is changed.

B. All data in p1 and p3 partitions is removed, but the table definition remains unchanged.

C. Only the first partition (p1) will be dropped because only one partition can be dropped at any time.

D. It results in a syntax error because you cannot specify more than one partition in the same statement.

A

A. All data in p1 and p3 partitions is removed and the table definition is changed.

Explanation
When this variable is enabled, the server does not use the optimized method of processing an ALTER TABLE operation. It reverts to using a temporary table, copying over the data, and then renaming the temporary table to the original,

51
Q

An administrator installs MySQL to run under a mysql OS account. The administrator decides to disable logins to the mysql account by using /nologin or /bin/false as the user’s shell setting.

Which statement is true?

A. The mysql user needs a login and its home directory must be the base directory of the installation.

B. The OS needs to allow logging in as mysql so that administrative tasks can be performed.

C. This prevents mysql from starting when standard startup scripts are used.

D. This prevents creation of a command shell wit the mysql account, while allowing mysql to run.

A

A. The mysql user needs a login and its home directory must be the base directory of the installation.

52
Q

Your developer have created a highly normalized schema that requires complex queries with many JOIN operations to retrieve data.

What information will you use to determine an optimum value for –join-buffer-size?

A. The size of he longest row in any table that participates in a JOIN query.

B. The total size of all tables in your most complex JOIN query.

C. the size of the largest table in any JOIN query.

D. The size of the smallest table in any JOIN query.

A

C. the size of the largest table in any JOIN query.

53
Q

In which two situations would you use unencrypted data transfers from the MySQL service?

A. when using the semi-synchronous replication plugin

B. when performing backups of credit card information to a remote location

C. when highest possible speed of transfer is required regardless of security

D. when the service is using socket-only connections and the host is secure

A

C. when highest possible speed of transfer is required regardless of security

D. when the service is using socket-only connections and the host is secure

54
Q

What are two benefits of using the –tab option with mysqldump?

A. The schema and data are automatically dumped to separate files.

B. It can be piped directly into a running server.

C. It is possible to restore the data in parallel.

D. It can be used together with –all-databases.

A

A. The schema and data are automatically dumped to separate files.

D. It can be used together with –all-databases.

Explanation
This option should be used only when mysqldump is run on the same machine as the mysqld server. Because the server creates *.txt files in the directory that you specify, the directory must be writable by the server and the MySQL account that you use must have the FILE privilege. Because mysqldump creates *.sql in the same directory, it must be writable by your system login account.

55
Q

You want create the first configuration file for a new installation of MySQL.

  • You will start mysqld manually(not automate it to start when the host machine starts or execute as a service)
  • You will stop myqld using mysqladmin.
  • You will interact with mysqld by using only the command-line client mysql.

Which option identifies a maximal set of sections where you can put the “max_allowed_packet=16M” parameter without creating a problem?

A. [mysqladmin]

B. [mysql] and [mysqld] and [mysqladmin]

C. [mysql] and [mysqld]

A

B. [mysql] and [mysqld] and [mysqladmin]

56
Q

The MySQL user adam currently has USAGE permissions to the database.

The football database is transactional and has non-stop updates from application users, The adam user needs to be able to take consistent backup of the football database by using the –single-transaction option.

Which extra GRANT permissions are required for adam to take mysqldump backups?

A. The adam user must also have SELECT on the football databases for backups to work.

B. The adam user must have the SUPER privilege in order to take data backups.

C. The adam user needs the PROCESS privilege to be able to take a consistent backup while other users are connected.

D. The adam user must also have SINGLE TRANSACTION global grant to take a consistent backup.

A

A. The adam user must also have SELECT on the football databases for backups to work.

57
Q

The InnoDB tablespace is corrupted and you start the server with option –innodb_force_recover=4.

Which backup method would you use to reload the corrupted InnoDB tables?

A. a binary backup taken with MySQL Enterprise Backup that can backup even corrupted tables

B. a binary backup that uses transportable tablespaces and allows you to reload a corrupted table

C. A text backup. InnoDB does not allow you to make binary backups while the server is running.

D. A text backup. A binary backup will still contain the corrupted segments.

A

C. A text backup. InnoDB does not allow you to make binary backups while the server is running.

Explanation
innodb_force_recovery is 0 by default (normal startup without forced recovery). The permissible nonzero values for innodb_force_recovery are 1 to 6. A larger value includes the functionality of lesser values.

1 (SRV_FORCE_IGNORE_CORRUPT)–> Lets the server run even if it detects a corrupt page. Tries to make SELECT * FROM tbl_name jump over corrupt index records and pages, which helps in dumping tables.

2 (SRV_FORCE_NO_BACKGROUND) –> Prevents the master thread and any purge threads from running. If an unexpected exit would occur during the purge operation, this recovery value prevents it.

3 (SRV_FORCE_NO_TRX_UNDO) –> Does not run transaction rollbacks after crash recovery.

4 (SRV_FORCE_NO_IBUF_MERGE)–> Prevents insert buffer merge operations. If they would cause a crash, does not do them. Does not calculate table statistics. This value can permanently corrupt data files. After using this value, be prepared to drop and recreate all secondary indexes. Sets InnoDB to read-only.

5 (SRV_FORCE_NO_UNDO_LOG_SCAN)–> Does not look at undo logs when starting the database: InnoDB treats even incomplete transactions as committed. This value can permanently corrupt data files. Sets InnoDB to read-only.

6 (SRV_FORCE_NO_LOG_REDO)–> Does not do the redo log roll-forward in connection with recovery. This value can permanently corrupt data files. Leaves database pages in an obsolete state, which in turn may introduce more corruption into B-trees and other database structures. Sets InnoDB to read-only.

58
Q

While reviewing the MySQL error log, you see occasions where MySQL has reached the number of file handles allowed to it by the operating system.

Which method will reduce the number of file handles in use?

A. relocating your data and log files to separate storage devices

B. implementing storage engine data compression options

C. activating the MySQL Enterprise thread pool plugin

D. disconnecting idle localhost client sessions

A

C. activating the MySQL Enterprise thread pool plugin

59
Q

Consider the ANALYZE TABLE command.

In which two situations should this command should be used?

A. when you want to update index distribution statistics

B. when you need to find out why a query is taking a longs time to execute

C. when you want to check a table’s structure to see if it may have been damaged

D. after large amounts of table data have changed.

A

A. when you want to update index distribution statistics

D. after large amounts of table data have changed.

60
Q

You execute mysqladmin shutdown on a MySQL server that is described as follows:

  • It is running with both active and idle client connections.
  • It has open transactions against InnoDB.
  • It has active multi-row inserts into MyISAM engine tables.
  • Innodb_fast_shutdown is set to 1.

What are three effects of shutting down the server by using a mysqladmin shutdown command?

A. Connections that have an open transaction are rolled back.

B. Connections with statements running against MyISAM tables wait for completion.

C. New client connections are not accepted after shutdown is initiated.

D. Connections are accepted during the shutdown process because a graceful shutdown can take large amounts of time.

E. Partial updates may occur for non-transactional tables.

A

A. Connections that have an open transaction are rolled back.

C. New client connections are not accepted after shutdown is initiated.

E. Partial updates may occur for non-transactional tables.

61
Q

The ‘applicationdb’ is using InnoDB and consuming a large amount of file system space. You have a /backup partition available on NFS where backups are stored.

You investigate and gather this information:

[mysqld]
datadir=/var/lib/mysql/
innodb_file_per_table=0
Three table are stored in the InnoDB shared tablespace and the details are as follows:

The table data_current has 1,000,000 rows.

The table data_reports has 1,500,000 rows.

The table data_archive has 4,500,000 rows.

You attempt to free space from ibdata1 by taking a mysqldump of the data_archive table and storing it on your backup partition.

shell> mysqldump -u root -p applicationdb data_archive > /backup/data_archive.sql
mysql> DROP TABLE data_archive;
Unfortunately, this action does not free any actual disk space back to the files system and the server disk space is running out.

Which set of actions will allow you to free disk space back to the file system?

(missing multiple choices)

A

Take a backup, stop the server, remove the data files, and restore the backup:

shell> mysqldump -u root -p applicationdb > /backup/applicationdb.sql

shell> /ect/init.d/mysql stop

shell> cd /var/lib/mysl/

shell> rm ibdata1 id_logfile0 ib_logfile1

shell> /etc /init.d/mysql start

shell> mysql -u root -p applicationdb > /backup/applicationdb.sql

62
Q

You want to use mysqldump to create a full backup with the following requirements:

It must include all schema and data.

All CREATE statements must exist in the dumps

The command should be future-proofed to include changes to the schema at a later data without requiring modifications to the mysqldump command.

Which three options in addition to the default settings must be used to ensure this?

A. –all-databases

- create-options
- master-data

B. -routines

- tables
- events

C. -create-options

- tables
- master-data
A

A. –all-databases

- create-options
- master-data
63
Q

You have a scheduled task on Linux that executes mysqldump against the localhost server periodically.

When checking the logs of this event to ensure that things are working and that backups will restore, you notice an output that is concerning. The command the scheduled task is executing as follows:

$ mysqldump -u backupuser -h 127.0.0.1 -pt100043va living –protocal=TCP > /backups/latest.sql
Warning: Using a password on the command-line interface can be insecure.

How do you resolve this issue?

A

2 ways:

Store your password in an option file eg: ~/my.cnf and use –defaults-file so that it is read and used.
[client]
password=t100043va

Use mysql_config_editor, which allows you to store encrypted login credentials in your home directory.

64
Q

A MySQL replication master is set up by using global transaction identifiers(GTIDs). You execute this statement:

mysql> CREATE TABLE datatarget SELECT * FROM datasource;
ERROR 1786 (HY000): CREATE TABLE ... SELECT is forbidden when @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1.

Why is this statement forbidden?

A. GTIDs have detected that a slave is inconsistent and therefore, disallow updates until the problem is resolved.

B. The datasource table is using an older InnoDB tablespace format, which is not compatible with GTIDs.

C/ The datasource table is using the MyISAM engine, which is not compatible with GTIDs.

D. The statement cannot be logged in a transactionally safe manner.

A

D. The statement cannot be logged in a transactionally safe manner.

65
Q

[mysql]
port=3301

[mysqld]
port=3302

[mysqld@replica]
port=3303

[replica]
port=3304

You issue this command to start MySQL Server:
systemctl start mysqld@replica

On which port is the server listening ?

A. 3301
B. 3303
C. 3302
D. 3304

A

D. 3304

66
Q

What three are correct statements about MySQL backups? (Choose three.)

A. They are used to set up the initial binary log files
B. They are used to prevent data corruption
C. They are used to set up a replication slave
D. They are used to prevent data theft
E. they are used to recover data
F They are used to set up a test system

A

B. They are used to prevent data corruption

C. They are used to set up a replication slave

E. they are used to recover data

67
Q

Assuming that a user has correct privileges, which Linux console command will fail to shut down a MySQL server?

A. mysqld -e ‘shutdown’
B. service mysqld stop
C. mysqladmin shutdown
D. mysql -e ‘shutdown’

A

A. mysqld -e ‘shutdown’

68
Q

What are three typical causes of MySQL becoming suddenly slow and unavailable (Choose three.)

A. A configuration change was made.

B. The hardware includes a single point of failure.

C. Monitoring ha not enabled all Performance Schema instruments.

D. The MySQL Query Cache is disabled.

E. OPTIMIZE TABLE is not executed for the InnoDB tables

F. The application executes a new untested query.

A

A. A configuration change was made.

B. The hardware includes a single point of failure.

F. The application executes a new untested query.

Not D. The MySQL Query Cache is disabled. because query _cache has been removed

69
Q

You are using the mysqldumpslow utility to view the contents of the slow query log. You notice the letter ‘N’ and character

string ‘S’ in a number of location in the output.

What does the ‘N’ indicate?

A. the number of times the statement was executed.

B. a abbreviation for NULL in a statement

C. the name of the user issuing the statement

D. an abstracted substitution for numbers indicated in WHERE clauses

A

D. an abstracted substitution for numbers indicated in WHERE clauses

70
Q

Which statement best describes a “warm” backup?

A. It is similar to a ‘cold’ backup, but differs in that it permits write operations.

B. It backs up the binary log, which contains the most recent ‘warm’ changes.

C. It is similar to a ‘hot’ backup, but differs in that it doesn’t permits write operations.

D. It only backs up ‘warm’ data, that is, data that has been recently modified.

A

C. It is similar to a ‘hot’ backup, but differs in that it doesn’t permits write operations.

71
Q

You want to grant full access over the application schema “app_db” to developers in your company.

To achieve this you have created a role “app_developer” and granted it to all your developers account.

What privileges would you grant to “app_db”? (Choose one).

A. GRANT SUPER ON . TO app_developer;

B. GRANT ALL ON app_db* TO app_developer;

C. GRANT ALL ON . to app_developer;

D. GRANT INSERT, UPDATE, DELETE ON app_db* TO app_developer;

A

B. GRANT ALL ON app_db* TO app_developer;

72
Q

After upgrading your MySQL server to 8.0.16 you find some problems and Oracle Support recommends you to force the upgrade of the data dictionary to fix the issues. You execute:

A. mysqld –upgrade=FORCE
B. mysql_upgrade –force

A

A. mysqld –upgrade=FORCE

73
Q

What is MySQL Enterprise Audit 8.0?

A. A MySQL server plugin

B. An independent process running in the same server that MySQL server

C. An independent process running in the same or a different server that MySQL server.

A

A. A MySQL server plugin

74
Q

User bob@% has the following roles granted: app_read and app_write.

How would you show the privileges for bob@% when it uses app_write? (Choose one).

A. SHOW GRANTS FOR bob@’%’;
B. SHOW GRANTS FOR bob@’%’ USING ‘app_write’;

A

B. SHOW GRANTS FOR bob@’%’ USING ‘app_write’;

Explanation
Roles can be not enabled by default, you will need to use the SHOW GRANTS FOR… USING syntax to show privileges for non-default roles.

75
Q

Which of those are valid methods for creating a new user in MySQL 8.0? (Choose two).

A. CREATE USER joe IDENTIFIED WITH caching_sha2_password by ‘secret’;

B. GRANT SELECT ON . TO joe;

C. CREATE USER joe IDENTIFIED BY PASSWORD ‘secret’;

D. CREATE USER joe IDENTIFIED BY ‘secret’;

A

A. CREATE USER joe IDENTIFIED WITH caching_sha2_password by ‘secret’;

D. CREATE USER joe IDENTIFIED BY ‘secret’;

Explanation
In MySQL 8.0 auto creation of users granting privileges was removed.

Creating a user with “IDENTIFIED BY PASSWORD ‘password’” is also removed

76
Q

Which dynamic privilege would you grant to a user that will manage the roles used by other database users? (Choose one).

A. ROLE_ADMIN
B. PRIVILEGES_ADMIN
C. USER_ADMIN

A

A. ROLE_ADMIN

Explanation
ROLE_ADMIN enables a user to grant/revoke roles to other users

77
Q

You want to use MySQL Enterprise Backup 8.0 to perform backups in your database. What type of backups are supported by this tool? (Choose two).

A. Warm backup
B. Cold backup
C. Hot backup

A

A. Warm backup

C. Hot backup

78
Q

Which MySQL defined privilege allows the user to monitor sessions in execution?

A. SHOW SESSION
B. ADMIN
C. PROCESS

A

C. PROCESS

Explanation
PROCESS allow a user to monitor other sessions in execution

79
Q

You want to create an account capable of changing the privileges of other user accounts, but not able to modify system accounts.

You will grant the following privileges to that account:

A. SUPER
B. SYSTEM_USER
C. ALL WITH GRANT OPTION

A

C. ALL WITH GRANT OPTION

Explanation
Only accounts with SYSTEM_USER can modify other system accounts.

If the user has all privileges with the re-grant option it will able to modify other user accounts.

80
Q

In MySQL 8.0 which is the default authentication plugin?

A. cleartext_password
B. mysql_native_password
C. sha256_password
D. caching_sha2_password

A

D. caching_sha2_password

Explanation
caching_sha2_password is the new default authentication plugin for clients in MySQL 8.0

81
Q

How can you limit the memory used by the query cache component to 512MB in MySQL 8.0?

A. You can not; Query Cache has been removed

B. query_cache_size=’512’

A

A. You can not; Query Cache has been removed

Explanation
Query Cache was deprecated in MySQL 5.7 and completely removed in 8.0. You cannot use it anymore.

82
Q

Which two are features of MySQL Enterprise Firewall? (Choose two.)

A. recording incoming SQL statement to facilitate the creation of a whitelist of permitted commands.

B. blocking of potential threats by configuring pre-approved whitelists

C. modifying SQL statement dynamically with substitutions

D. automatic locking of user accounts who break your firewall

E. provides stateless firewall access to TCP/3306

A

B. blocking of potential threats by configuring pre-approved whitelists

C. modifying SQL statement dynamically with substitutions