Database User Privilege Model Checklist
Database users should have only the permissions they need. A website user usually does not need full root access. Weak privilege design increases damage if the application is compromised.
Core principle
Separate administration from application access. Root or admin users manage the database server. Application users should access only the required database with limited privileges.
Checklist
- List database users.
- Identify which user belongs to each application.
- Check grants for each application user.
- Remove unused database users.
- Avoid using root in application configs.
- Limit user access to the required database only.
- Rotate passwords for unknown or old users.
- Document which app uses which user.
- Test application after privilege changes.
- Review privileges after every migration.
Reusable lesson
Privilege thinking applies to Linux users, WordPress users, database users, API keys, cloud IAM and automation service accounts.
When to Use This Checklist
Use this checklist when hardening database access for WordPress, apps, APIs, dashboards or automation services.
Required Tools
Database admin access, application config, database CLI, user inventory, backup, password manager
Before You Start
Before changing grants, back up the database and know which application depends on each database user.
Structured Checklist Steps
- List database users.
- Map users to apps.
- Check grants.
- Remove unused users.
- Avoid root app usage.
- Limit database scope.
- Rotate old passwords.
- Document ownership.
- Test applications.
- Review after migration.
Verification Steps
- No application uses root unnecessarily.
- Each database user has a known purpose.
- Unused users are removed or disabled.
- Application still works after privilege review.
- Privilege map is documented.
Rollback Plan
If privilege tightening breaks an application, restore only the minimum missing privilege instead of giving full global admin access.
Common Mistakes
- Using root in wp-config.php.
- One database user for every application.
- No grant review.
- Keeping users from old projects.
- Granting global privileges unnecessarily.
Related Commands
mysql -u root -p
SELECT user,host FROM mysql.user;
SHOW GRANTS FOR 'db_user'@'localhost';
CREATE USER 'app_user'@'localhost' IDENTIFIED BY 'strong_password';
GRANT SELECT,INSERT,UPDATE,DELETE ON app_db.* TO 'app_user'@'localhost';
FLUSH PRIVILEGES;