Emergency server help: get in touch

MySQL/MariaDB won’t start: crash recovery runbook Pro

When MariaDB won't start after a crash, this runbook reads the error log first, matches the common causes, walks innodb_force_recovery levels 1 to 6 safely, and rebuilds from a dump on cPanel and DirectAdmin.

Published Updated 9 min read
ProThis is part of srvScripts Pro. See what Pro includes.

When MariaDB won’t start, every site on the server is down and the temptation is to try things until it runs: delete the InnoDB log files, set innodb_force_recovery = 6, reinstall the package. Each of those can turn a recoverable crash into permanent loss. The error log almost always names the cause in its last 50 lines. This runbook reads it first, matches the cause, and only reaches for forced recovery with a copy of the data directory in hand. The same steps apply to MySQL; where commands differ, both are shown.

Symptoms

  • Sites show “Error establishing a database connection”; clients get Can't connect to local server through socket '/var/lib/mysql/mysql.sock' (2).
  • systemctl start mariadb fails or the service restarts in a loop.
  • cPanel’s service monitor sends “mysql failed” alerts every few minutes.

First 5 minutes

Stop the panel’s monitor from restarting it while you work, because each failed start can make InnoDB corruption worse:

srvScripts Pro

The rest of this is for Pro members.

Pro removes ads and adds Pro scripts, runbooks, 50 monitors, the Tools API and a bigger AI quota — and it keeps the free tools free.

See Pro plansSign in

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.