π ~1 min read
Table of contents
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

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

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.
Related Errors & Cross-Refs
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.