Skip to main content

MySQL Restarting - Note -usr-sbin-mysqld: Normal shutdown

Comments

12 comments

  • Babene7
    Hello, For how long does MySQL stay down? Does it happen at the same time every night? Do you have any crons running at the same time that the issue occurs? Normally, MySQL doesn't restart on its own, usually it's something else that triggers the restart, for example, cPanel's monitor function (WHM > Service Manager) if the MySQL service is detected to be down. If the issue happens always at the same time I bet that it's triggered by a cron. Regarding logs, you can check MySQL's log if you have it enabled. By default the path is /var/lib/mysql/yourhostname.err
    0
  • kieran_kkcs
    Hi, I have cron jobs running, but they're php scripts. It looks like it shutdown and restarted immediately. I've attached two files, one is the section from mysqld.log and the other is the cron jobs. It happens at the same time, but not every night. Thanks Kieran
    0
  • cPanelWilliam
    Hello! [QUOTE] It looks like it shutdown and restarted immediately. I've attached two files, one is the section from mysqld.log and the other is the cron jobs.
    Does the time of the MySQL restart align with any of the cron jobs running on the server? I checked your reply but didn't see any files attached for review. You can check /var/log/cron
    to compare the timestamps of crons that were executed around the time MySQL was last restarted. If you notice that the mysqluserstore cron is restarting MySQL, then the following article would guide you on resolving the issue:
    0
  • kieran_kkcs
    Hi, apologies, the files didn't attach because they were in the wrong format and I didn't spot it. Should be there now.
    0
  • cPRex Jurassic Moderator
    Was there a minor update to MySQL? You can run "dnf history" to see if a MySQL package was updated, as shortly after 1AM is when I would expect that to happen.
    0
  • kieran_kkcs
    Hi, thanks for that. I couldn't find the dnf command, I don't think I have the right version of centos for that. It restarted last night again at 01:28. In the cron logs there were nothing that was running at that time. I grepped Out Of Memory in /var/log, and the last entry was at the end of June when I did run out of RAM. However, when I do sar -r, it says the average memory usage is 97% (screenshot attached) but when I look at the process manager in WHM there doesnt appear to be anything that's hogging that amount of memory. It is a pain as I'm getting 2K+ error message emails per night.
    0
  • cPRex Jurassic Moderator
    If you don't have dnf, you can check /var/log/yum.log to see if the package update happened then. However, that wouldn't account for all the error messages you're seeing. It might be best to submit a ticket to our team so we can check this directly on your machine.
    0
  • kieran_kkcs
    Hi, thanks. The error messages are coming from my php scripts as they continue to run despite the MySQL server being down for a short while. I checked yum.log as per your suggestionand the last entry was from March,so that can't be it. I'll submit a ticket. Thank you.
    0
  • cPRex Jurassic Moderator
    Once you have it, let me know the ticket number so I can follow along and keep this thread updated.
    0
  • kieran_kkcs
    Thanks, it looks like its 94463287
    0
  • cPRex Jurassic Moderator
    Thanks for that - I'm following along with that ticket on my end now.
    0
  • cPRex Jurassic Moderator
    I don't see our team was able to find much either, even with direct access to the system. I do see where we recommended having a MySQL administrator examine the machine to see if more information could be found, but it seems there just isn't much to go on with the details we found.
    0

Please sign in to leave a comment.