Affected versions: RHEL 10

πŸ“– ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution β€” Primary Fix
  7. Solution β€” Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Database service fails, causing immediate application outage and transaction failures.

Environment & Reproduction

Usually follows datadir move, backup restore, or SELinux context drift.

systemctl status mariadb ; sudo journalctl -u mariadb -n 120

Root Cause Analysis

Incorrect ownership, mode, or SELinux type prevents mysqld from reading/writing required files.

Quick Triage

Inspect datadir permissions and check for AVC denials before changing config.

ls -ldZ /var/lib/mysql ; sudo ausearch -m avc -ts recent | tail

Step-by-Step Diagnosis

Validate configured datadir/tmpdir and permissions referenced by my.cnf.

grep -E 'datadir|tmpdir' /etc/my.cnf /etc/my.cnf.d/*.cnf ; ls -laZ /var/lib/mysql
Illustrative mockup for rhel-10 β€” mariadb-permission-log
MariaDB start failure in journal β€” Illustrative mockup β€” Progressive Robot

Solution β€” Primary Fix

Set correct ownership and SELinux labels, then restart service.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo chown -R mysql:mysql /var/lib/mysql ; sudo chmod 750 /var/lib/mysql ; sudo restorecon -Rv /var/lib/mysql ; sudo systemctl restart mariadb
Illustrative mockup for rhel-10 β€” mariadb-permission-fix
Ownership and context corrected for datadir β€” Illustrative mockup β€” Progressive Robot

Solution β€” Alternative Approaches

Reinitialize temporary instance for recovery and restore from consistent backup.

Verification & Acceptance Criteria

MariaDB stays active and application read/write checks pass.

systemctl is-active mariadb ; mysql -e 'SELECT 1;'

Rollback Plan

Revert my.cnf path changes and restore previous datadir backup if needed.

Prevention & Hardening

Standardize database path changes with SELinux and ownership post-check scripts.

Similar to PostgreSQL startup failures from data directory context mismatch.

Related tutorial: View the step-by-step tutorial for rhel-10.

View all rhel-10 tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

MariaDB on RHEL administration and SELinux integration guidance.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β€” we respond within one business day.