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.
Read more:
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.
Related Posts:
- [CYBER MONDAY] VirMach VPS Huge deals as low as $4/year! - November 27, 2017
- [CYBER MONDAY] HudsonValleyHost – $4.99/mo 5GB OpenVZ (normally $20/mo) and 40% OFF select items! - November 27, 2017
- [CYBER MONDAY] YourLastHost – Shared Hosting Specials! - November 27, 2017
IMHO, out of these tips only 4 & 5 apply to situation when mysql has been running, suddenly stopped and can not be restarted (“your MySQL database has gone offline”). If you had problems with config, permissions or ports, mysql could never go offline because it could never start.
Personally, if I have problem with some app/service, I start with checking logs before doing anything else. There should be clear indication for every of those problems mentioned above…
Great feedback, thanks Jarry :-)
You’d be surprised though, when a server exchanges a lot of hands, especially with hands who aren’t familiar with the setup, or even worse, incompetent technicians messing up configurations, it happens more often than you think. We used to sell server management plans and almost 99% of the time MySQL failing to start errors was one of those five reasons.
Julian
This doesn’t really address anything beyond using basic common sense.
For the given examples, the first four seem the most likely for an in-service-magically-stops issue.
Also, “User-with-root migrates to MariaDB without understanding consequences” would be a pretty good weigh-in for #7, from what I’ve seen.. but those are usually immediately obvious, and only 2AM when designed to be done at 2AM ;)
Hello Julian,
I have not expected this quality of tutorial from LEB Team.
Please add value to content like PRO, not like less than a basic user and sure, you people can do.
I am a regular visitor to LEB. I am surprised after reading a couple of tutorials here.
Hope you understand my point.
Regards
Duly noted, and more advanced tutorials are in the works. I appreciate your insight, but remember not everyone is a server expert like you are! :-)
I’m sure this article is highly helpful to those who are coming from search engines like Google too.
Julian
Hello Julian,
Thank you for noticing it. I think 99.99% audience of LEB is professional because they are managing their Dedi or Virtual Servers and that is not an easy task at all. Sometimes, they raise such typical points in comments that surprises me.
I am also an SEO expert, and if your audience reads and comments your articles then it raises your PA (page authority) and ranks well in Google.
To engage LEB audience is only possible through GREAT articles, not even average as I have noticed. Big G (Google) knows our audience interest better than us and believe me this right by my experience.
Thank you for your contribution.
Regards