• 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 , restart mysql windows 10
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, 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

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Fix WordPress Error in Database Connection : MySQL Part

    MySQL Setup & Corrupted Database Has to Do With the Error Establishing a Database Connection. Fix WordPress Error in Database Connection.

  • Steps to Install Percona MySQL Server on Ubuntu 18.04 LTS

    Here is Latest, Tested Steps to Install Percona MySQL Server on Ubuntu 18.04 LTS For Cloud Server, VPS and Dedicated Server.

  • Join/Merge Multiple Log Files For Big Data Analysis

    Here Are The Ways To Join/Merge Multiple Log Files For Big Data Analysis, Store Them To OpenStack Based Cloud Storage And Delete Old Files.

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

Get new posts by email:

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 (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Legal and Moral Aspects of Data MiningDecember 6, 2023
  • How Decision Support System WorksDecember 6, 2023
  • Types of Classification MethodsDecember 5, 2023
  • Time Series Analysis: OverviewDecember 5, 2023
  • Data Mining IssuesDecember 4, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

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

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