It’s 2 AM, you’re up late working on your website, and you find that your MySQL
database has gone offline. You log into your server to troubleshoot, and the following unpleasant
error message appears in your SSH terminal:
# service mysqld restart
Stopping mysqld: [ OK ]
Timeout error occurred trying to start MySQL Daemon.
Starting mysqld: [FAILED]
There are a number of issues that can lead to MySQL errors, and not one article can
cover the hundreds of possibilities that could cause a MySQL server to fail to start,
however, in this tutorial we will be covering the most common resolutions for this error.
1. Configuration Errors – We’ll start off with the most common issue – which is all
within one file on your server located at /etc/my.cnf. This is the file that is vital to
a successful MySQL server. This configuration file stores all of your MySQL
settings, if there are any errors or unsupported configurations in this
configuration, it can cause the MySQL server to fail to start.
2. Incorrect Permissions – Check if proper permissions are in place! Permissions
of the MySQL files such as binaries or the ‘/var/lib/mysql’ folder can get
accidentally changed when multiple hands touch a server’s configuration.
3. MySQL port in use by another application – If another application on your
server is running on Port 3306 it can cause MySQL to fail to start.
4. Disk Space Full – Is your server disk space full? Or the /tmp partition full? If so,
this is why MySQL will fail to start as well. Check your disk space by running the
“df -h” command!
5. Out of memory – If MySQL process is not getting enough memory due to
abusive processes or any other valid process, it cannot start or would keep
crashing all the time.
These are the top 5 issues that can result to a MySQL server to not starting properly.
Go through each possibility, and chances are you’ll be on your way with a successful
MySQL start soon enough!
Are you facing an issue with starting MySQL on your server? Comment below, and our
community would be glad to help diagnose!
Special thanks to Julian Jin from AlphaRacks for sponsoring this tutorial.