MySQL DBA Account Authentication and Roles Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Attempts: 12 | Questions: 20 | Updated: Aug 15, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. What does the host part of 'user'@'host' control?

Explanation

In a database account written as `'user'@'host'`, the host part specifies where the user may connect from. It can identify an IP address, hostname, or a permitted range of hosts. This lets the database restrict access based on the client’s connection origin.

Submit
Please wait...
About This Quiz
MySQL DBA Account Authentication and Roles Quiz - Quiz

This quiz evaluates your knowledge of MySQL account authentication mechanisms and role-based access control. You'll test your understanding of user creation, password management, privilege assignment, and role administration in MySQL. Essential for database administrators managing secure and efficient database environments.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. True or False: You can grant privileges to a role before assigning it to users.

Explanation

A role can be configured independently of any user. You can grant permissions to the role first, defining what its members will be allowed to do, and then assign that role to users later. Once assigned, users inherit the role’s privileges, simplifying access management and ensuring consistent permissions across multiple users.

Submit

3. True or False: The root user always has the password 'root' by default.

Explanation

The root account does not always have the password “root.” Its password depends on the operating system and how it was configured. On many systems, the root account is initially locked or has no password set, and an administrator must configure access separately. Always using “root” as the default password would also create a serious security risk.

Submit

4. True or False: The wildcard '%' in hostname matches any character except the dot.

Explanation

In hostname patterns, `%` matches any sequence of characters, including dots. Therefore, it is not limited to characters other than a dot.

Submit

5. What does the FLUSH PRIVILEGES statement do?

Explanation

`FLUSH PRIVILEGES` makes the database server reload its grant tables, applying privilege changes made directly to those tables. Changes made through commands such as `GRANT` or `REVOKE` are typically applied automatically and don’t require this statement.

Submit

6. True or False: A user with 'user'@'%' can connect from any host.

Explanation

In MySQL, the `%` in `'user'@'%'` is a wildcard for the host portion of the account. It allows the user to connect from any host, provided the server is reachable and the account’s password and privileges permit access.

Submit

7. Which statement revokes a specific privilege from a user?

Explanation

`REVOKE` removes a previously granted privilege. Here, `SELECT` is revoked from the specified user on all tables in the `db` database. The other options use invalid privilege-management syntax.

Submit

8. Which statement creates a new MySQL user account?

Explanation

`CREATE USER` is the MySQL command for creating an account. The `username` and `host` identify the account, while `IDENTIFIED BY` sets its password. The other options are not valid MySQL syntax for creating a user.

Submit

9. Which table stores user account information in MySQL?

Explanation

MySQL stores account information in the `mysql.user` system table. It contains details such as account names, allowed hostnames, authentication data, and account privileges. The other listed names are not the standard table used for MySQL user accounts.

Submit

10. What is the primary purpose of the SUPER privilege?

Explanation

The SUPER privilege provides elevated administrative access in MySQL, allowing users to perform server-level operations such as FLUSH and SHUTDOWN. It is intended for database administration rather than routine tasks like creating databases or executing stored procedures.

Submit

11. Which privilege is required to create a role in MySQL 8.0+?

Explanation

MySQL 8.0+ requires the `CREATE ROLE` privilege to create roles. `SUPER` is a legacy, deprecated privilege and is not the required privilege for this operation, so the provided answer appears incorrect.

Submit

12. What is the correct syntax to grant all privileges on a database to a user?

Explanation

`GRANT ALL ON database.* TO 'user'@'host';` grants the specified account all privileges on every table in the named database. The `database.*` pattern applies the permissions across the database, while `'user'@'host'` identifies the account receiving them.

Submit

13. Which column in mysql.user stores the hashed password?

Explanation

In modern MySQL, the `authentication_string` column in the `mysql.user` system table stores the credential data used by the account’s authentication plugin, typically including a password hash. Older MySQL versions used a column named `Password`, but `authentication_string` is the appropriate choice for current versions.

Submit

14. What does the GRANT OPTION privilege allow a user to do?

Explanation

The GRANT OPTION lets a user pass a privilege they hold to other users or roles, provided they have permission to delegate it. It does not allow them to create new privilege types or modify grant tables directly.

Submit

15. To assign a role to a user in MySQL 8.0+, use the ____ statement.

Explanation

In MySQL 8.0 and later, the GRANT statement gives a role to a user account, allowing that account to receive the privileges bundled in the role. The role must already exist, and the basic syntax is `GRANT role_name TO 'user'@'host';`. This separates assigning permissions from defining the role itself.

Submit

16. Which privilege allows a user to modify table structures?

Explanation

The ALTER privilege allows a user to change a table’s structure, such as adding, removing, or modifying columns and constraints. It grants permission to make structural changes without necessarily granting other privileges, such as reading or updating the table’s data.

Submit

17. Which privilege allows a user to execute stored procedures?

Explanation

The EXECUTE privilege grants a user permission to run stored procedures. It can be assigned for specific database objects, allowing the user to invoke a procedure without necessarily having permission to create, alter, or delete it. PROCEDURE identifies an object type, while CALL is a command used to invoke procedures in some database systems.

Submit

18. The statement to drop a user account is DROP USER ____.

Explanation

In MySQL, a user account is identified by both its username and the host from which it may connect. Thus, `user@host` fills the blank to specify the account being removed. In actual SQL, the account is typically written as `'user'@'host'`, as in `DROP USER 'user'@'host';`.

Submit

19. Which privilege allows viewing table structure but not accessing data?

Explanation

The SHOW privilege allows users to view table metadata, such as its structure, without granting permission to read the rows stored in the table.

Submit

20. The correct syntax to change a user's password is ____.

Explanation

`ALTER USER` is the SQL statement used to modify an existing account’s settings, including its password. The exact syntax varies by database system; some use `ALTER USER username IDENTIFIED BY 'new_password'`, while others use a `PASSWORD` clause. This command updates the credentials associated with the specified user account, provided appropriate authorization is available.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What does the host part of 'user'@'host' control?
True or False: You can grant privileges to a role before assigning it...
True or False: The root user always has the password 'root' by...
True or False: The wildcard '%' in hostname matches any character...
What does the FLUSH PRIVILEGES statement do?
True or False: A user with 'user'@'%' can connect from any host.
Which statement revokes a specific privilege from a user?
Which statement creates a new MySQL user account?
Which table stores user account information in MySQL?
What is the primary purpose of the SUPER privilege?
Which privilege is required to create a role in MySQL 8.0+?
What is the correct syntax to grant all privileges on a database to a...
Which column in mysql.user stores the hashed password?
What does the GRANT OPTION privilege allow a user to do?
To assign a role to a user in MySQL 8.0+, use the ____ statement.
Which privilege allows a user to modify table structures?
Which privilege allows a user to execute stored procedures?
The statement to drop a user account is DROP USER ____.
Which privilege allows viewing table structure but not accessing data?
The correct syntax to change a user's password is ____.
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!