Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

MySQL & MariaDB in Depth Module 12

Security and access control interview questions

Interview questions on security and access control: short warm-ups, then what each harder question tests, the first step of a good answer and its follow-ups.

8 questions: 3 warm-ups and 5 with model answers · Levels: Fresher to staff

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher to mid

    mysql_native_password and caching_sha2_password both check a password. How do they differ, and why does an upgrade past MySQL 8.4 care?

    Answered in the lesson MySQL accounts, authentication and TLS

  2. Mid

    The mysql client's --ssl-mode has five values. What does each one check, and which stops a client from talking to an impostor server?

    Answered in the lesson MySQL accounts, authentication and TLS

  3. Fresher to mid

    What makes a privilege dynamic rather than static?

    Answered in the lesson Privileges, roles and least privilege in MySQL

Questions with model answers

What each question tests, the first step of a good answer and the follow-ups to expect.

  1. Mid to senior

    An online store runs 40 application accounts on MySQL 8.4 with mysql_native_password=ON in my.cnf, and the team plans to move to 9.7 LTS. How do you find, migrate and verify those accounts so that no application loses its database connection, and in what order do the server changes happen?

    What it tests
    Knowing that 9.x has no server-side native plugin, tying each account to the application behind it, checking client libraries, ordering the moves on 8.4, and proving nothing needs the old plugin before the upgrade.
    First step
    Start on 8.4, not on 9.7. List the accounts on the old plugin from mysql.user and tie each one to the application and the client library that use it. The upgrade itself cannot rescue any of them: 9.7 has no server-side native plugin and will not even start with the option, so every account must already be on caching_sha2_password when the new version first starts.
    Follow-ups

    From the lesson MySQL accounts, authentication and TLS

    Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.

    Opening the model answers with your pass…

    Model answers open with any MySmartCoPilot pass.

    • Pro pass · 1 week₹79$2.99
    • 30 days₹179$5.99
    • 1 year₹1,699$45

    One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.

    It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).

    In the answer:

    • Model answer
    • Common mistakes
    • Rubric
    • Variants
    • about 6 minutes
  2. Mid to staff

    A payments service reaches its MySQL 8.4 primary across a data-centre network, and every client runs with the default connection settings. Security now asks that every connection be encrypted and that clients prove they reached the real server. Plan the change on the server, the accounts and the clients, and say how you confirm it worked.

    What it tests
    Telling encryption apart from server verification, issuing certificates whose names match how clients connect, ordering client, account and server changes so nothing breaks, and checking from the server which sessions use TLS.
    First step
    Find out how every client names the server (DNS names, addresses, a virtual IP) and issue a server certificate from an authority you control whose subjectAltName lists all of them. Until clients can verify that certificate, rules on the server could only force encryption, not prove which server answered.
    Follow-ups

    From the lesson MySQL accounts, authentication and TLS

    Model answer, Pro.

    In the answer:

    • Model answer
    • Common mistakes
    • Rubric
    • Variants
    • about 5 minutes
  3. Mid to senior

    A new team of five developers needs database accounts on a MySQL 8.4 server that holds application rows, a reporting replica of them and a payroll schema. Design the privilege set each account carries, the roles that group the privileges, and the one line that keeps payroll out of the operators' global SELECT.

    What it tests
    Picking the account shape per job, grouping privileges into roles, keeping SYSTEM_USER on DBAs, and knowing where a partial revoke replaces a one-off exclusion.
    First step
    Draw the matrix before writing any GRANT: list the job kinds down the side (application, migrator, reporting, backup, operator) and the schemas across the top. Decide at each cell whether the account reads, writes, both or nothing, so a role is a column of that matrix and SHOW GRANTS only has to confirm what the design already says. The replication account stays outside it: it reads the binary log, not rows.
    Follow-ups

    From the lesson Privileges, roles and least privilege in MySQL

    Model answer, Pro.

    In the answer:

    • Model answer
    • Common mistakes
    • Rubric
    • Variants
    • about 5 minutes
  4. Senior to staff

    A compliance review asks that no application account read payroll schemas, even though a handful of accounts inherited a global SELECT from a long-gone migration. You cannot drop and recreate every account during the week of the review. Plan the roll-out of partial revokes across one source and six replicas, and the proof you can hand to the auditor.

    What it tests
    Enabling partial_revokes safely, writing the revokes once on the source and letting replication copy them, checking on every replica that each restriction landed, and showing the auditor a before-and-after.
    First step
    Start with the audit, not the fix. Run the lesson's over-broad check against every replica (every account with a global SELECT and no payroll restriction), save the list and the row count, and agree with the auditor that reducing the list to zero is the proof.
    Follow-ups

    From the lesson Privileges, roles and least privilege in MySQL

    Model answer, Pro.

    In the answer:

    • Model answer
    • Common mistakes
    • Rubric
    • Variants
    • about 5 minutes
  5. Mid to senior

    During an incident, an operator asks you which accounts can read salaries. The server has twenty accounts, a handful of roles, a few partial revokes and three definer views on payroll.salaries. Write the audit that answers the question completely, with the queries you run and the way you read them.

    What it tests
    Covering the four access paths (own grants, active roles, definer views, administrators) with the seven queries, reading each row, and knowing which query is evidence for which path.
    First step
    Settle the question "what can read salaries" before you look at any account. A row is reached through the account's own grants, an active role's grants, a definer view it may select from, or an administrator's global privileges: four paths, and the audit must cover all four. Run the seven queries of audit_grants.sql in order and keep the outputs beside you.
    Follow-ups

    From the lesson Privileges, roles and least privilege in MySQL

    Model answer, Pro.

    In the answer:

    • Model answer
    • Common mistakes
    • Rubric
    • Variants
    • about 7 minutes

All MySQL & MariaDB in Depth interview questions · The MySQL & MariaDB in Depth track

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.