• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Auto Restart MySQL, mysqld : Wrong Concepts

By Abhishek Ghosh October 31, 2015 4:51 pm Updated on October 31, 2015

Auto Restart MySQL, mysqld : Wrong Concepts

Advertisement

Actually we have discussed it for WordPress Database Connection Error. MySQL, Percona, MariaDB Will Restart on Failure With Configured my.cnf. Wrong Concepts Around Auto Restart MySQL, mysqld are discussed in this guide plus needed my.cnf configuration shown. These two questions are frequently asked :

 

  1. Is there an option to automatically restart MySQL after a crash?
  2. Is there any script for automatic restart of the MySQL after a crash?

 

Auto Restart MySQL, mysqld : Wrong Concepts

 

MySQL, Percona, MariaDB – all basically same at this part. All has auto-restart system if installed from repo. At least for Deb GNU/Linux (Debian, Ubuntu) we have never seen any problem. Your concept is wrong – if mysqld crashed then mysqld_safe would restart it automatically because mysqld_safe is the control script. Provided that, your my.cnf looks right and restarted msqld / MySQL normally like :

Vim
1
service mysql restart

that is what written here for mysqld_safe :

Advertisement

---

Vim
1
https://dev.mysql.com/doc/mysql-startstop-excerpt/5.5/en/mysqld-safe.html

Basically, by default, at my.cnf under [mysqld_safe], all needed are not present, socket, PID if not present, probably mysqld can not restart on crash (I am not MySQL database expert) :

Vim
1
2
3
4
5
6
[mysqld_safe]
pid-file        = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
nice = 0
log_error=/var/log/mysqld.log
datadir=/var/lib/mysql

In real life – you really never need an external script to restart MySQL. Yeah, the above thing kill keep MySQL server up but, it may still die at some action when you’ll perform. It is unlikely to fail to restart on a well tuned my.cnf.

Restart mysql after the changes (if you need) :

Vim
1
service mysql restart

If still your MySQL do not auto-restart, then read the next sub header.

Auto Restart MySQL, mysqld

 

Auto Restart MySQL, mysqld : Check Your Error Log

 

Where is your error log, that you’ll know!. Suppose log is at /var/log/mysqld.log, then cat it :

Vim
1
cat /var/log/mysqld.log

Here is an example of error with huge output, this is real example.

In the log, there is clear history of crushes :

Vim
1
2
2015-10-27 08:10:16 7841 [Note] Starting crash recovery...
2015-10-27 08:10:16 7841 [Note] Crash recovery finished.

You need to fix the error of your error log. Your database may be corrupted or my.cnf has wrong settings, that is not getting restarted.

Tagged With mysql restart , can mysql be setup to auto restart on failure , mysql auto restart , mysql Restart=on-failure

This Article Has Been Shared 734 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Auto Restart MySQL, mysqld : Wrong Concepts

  • About Cloud Computing and Beyond

    About Cloud Computing many things has been published by us. There are more to say about Cloud Computing. This is a start up article on Cloud Computing for all.

  • What You Need to Know About Cloud

    What You Need to Know About Cloud – How Much is Enough for your purpose ? One must know the essentials in order to ensure security on social websites, for example.

  • Cloud App : Characteristics For Being a Cloud Application

    Cloud App must have some clearly defined characteristics. There must be some universal characteristics for being a Cloud Application from traditional Web App.

  • Smartphone Security in the Cloud

    Smartphone Security in the Cloud is important as the unprotected smartphones using Cloud based applications can create security and privacy issues.

  • Platform as a Service WordPress Free Hosting For Dummies

    Platform as a Service WordPress Free Hosting For Dummies is intended to guide the users who want a self hosted WordPress website with all fetters free of cost.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (20K Followers)
  • Twitter (4.9k Followers)
  • Facebook (5.8k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.2k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is a Loosely Coupled System? January 17, 2021
  • How To Repack Installed Software on Debian/Ubuntu January 16, 2021
  • Components of Agile Software Development January 15, 2021
  • What is Conway’s Law? January 14, 2021
  • Effects of Digitization on Companies : Part XIII January 13, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "Auto Restart MySQL, mysqld : Wrong Concepts," in The Customize Windows, October 31, 2015, January 18, 2021, https://thecustomizewindows.com/2015/10/auto-restart-mysql-mysqld-wrong-concepts/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2021 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy