Security for MySQL DBAs
MySQL security is the control of who can connect and what they can do, built on accounts, authentication plugins, roles and privileges granted with GRANT. Good security gives each user only the access required, protects connections with TLS, and keeps credentials out of reach.
Stage: Security and Backup · Part of the MySQL DBA roadmap · Last reviewed 19 November 2026
What to learn in Security
- Create an account with CREATE USER and grant only the privileges it needs
- Use roles to manage privileges for groups of users
- Require TLS for a user and verify the connection is encrypted
- Revoke privileges and drop anonymous or unused accounts
- Explain how caching_sha2_password differs from the older native password plugin
Security interview questions
Why is a MySQL account defined by user and host, not just name?
An account is identified as 'user'@'host', so the same name from different hosts can have different passwords and privileges. When a client connects, MySQL matches the most specific host pattern first, which lets you restrict access to certain networks.
What is the principle of least privilege in MySQL?
Each account receives only the privileges needed for its job, for example SELECT on one schema for a reporting user instead of ALL PRIVILEGES on everything. This limits the damage if a credential leaks or an application has an injection bug.
Where Security fits in the MySQL DBA roadmap
Security belongs to the Security and Backup stage (intermediate level). Protect the data.
Other units in this stage
Back to the full MySQL DBA roadmap