Fix MySQL / MariaDB Won't Start
Job for mariadb.service failedFailed to start MySQLcan't connect to local MySQL serverWhen MySQL/MariaDB won't start, the service status is vague but the error log is precise. Here's how to read it and fix the usual causes.
Read the error log first
The log says exactly why it died. Check the service status and the log:
systemctl status mariadb
journalctl -u mariadb --no-pager | tail -40
tail -50 /var/log/mysql/error.log # or /var/log/mariadb/
Cause 1: the disk is full
MySQL won't start if it can't write. Check space — if full, free some and try again (see no space left on device):
df -h
Cause 2: a bad config
A typo or bad value in my.cnf (e.g. an oversized buffer the box can't allocate) stops startup. The log names the bad directive — fix or revert your last config change.
Cause 3: port already in use
If 3306 is held by a stuck old instance, the new one can't bind. Find and stop it (see address already in use):
ss -tlnp | grep 3306
Cause 4: corrupted tables / crash recovery
After an unclean shutdown, InnoDB may fail recovery. The log will mention InnoDB; in serious cases an innodb_force_recovery value in my.cnf gets it up long enough to dump data. Back up first.
Before any forced-recovery or table-repair action, copy the data directory. Recovery options can be one-way — a backup is your safety net.
The error log names the cause: disk full, bad config, port clash or InnoDB recovery. Read it before changing anything.
MySQL is a trademark of Oracle Corporation. MariaDB is a trademark of MariaDB Foundation. ESAGAMES is an independent hosting provider, not affiliated with or endorsed by Oracle.
Managed databases that stay up
Our managed hosting runs and monitors MySQL/MariaDB for you, so game panels and sites keep their database.
Frequently asked questions
Why won't MariaDB/MySQL start?
Common causes are a full disk, a bad my.cnf value, port 3306 already in use, or InnoDB crash-recovery after an unclean shutdown. The error log (in /var/log/mysql or via journalctl) names the exact reason.
Where is the MySQL error log?
Usually /var/log/mysql/error.log or /var/log/mariadb/mariadb.log, and also via journalctl -u mariadb. It records precisely why startup failed.
My database crashed and won't recover — what now?
Back up the data directory first. Then read the InnoDB messages in the log; a controlled innodb_force_recovery value can bring it up long enough to dump your data. Get a backup before attempting repairs.
Related articles
Fix SSH "Connection refused" / "Connection timed out"
SSH "connection refused" vs "timed out" — what each means and the exact steps to fix them.
Read fix Linux & VPSFix "Permission denied" on Linux (chmod & chown Explained)
"Permission denied" on a script or file? Understand chmod/chown and fix it the right way.
Read fix Linux & VPSHow to Check CPU, RAM & Disk Usage on a Linux Server
The essential commands to check CPU, RAM and disk on Linux — and find what's eating them.
Read fix