The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL Service Won't Start

Discussion in 'Database Discussions' started by zlesavich, Nov 19, 2014.

  1. zlesavich

    zlesavich Member

    Joined:
    Aug 11, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    MySQL just randomly failed, and I can't figure out why. I get these emails saying the service failed:

    Code:
    	
    141119 17:13:41 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141119 17:13:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141119 17:12:52 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141119 17:12:51 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141119 17:12:46 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141119 17:12:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141119 17:08:42 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141119 17:08:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141119 17:04:04 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141119 17:04:02 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141119 17:02:50 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141119 17:02:48 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141119 15:24:03 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141119 15:24:02 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141119 15:22:48 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141119 15:22:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141118 22:05:09 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141118 22:05:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141118 22:03:58 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141118 22:03:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141118 18:33:29 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141118 18:33:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141118 18:28:51 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141118 18:28:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141118 18:27:37 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141118 18:27:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141118 16:52:35 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    2014-11-18 16:52:35 838 [Note] /usr/sbin/mysqld: Shutdown complete
    2014-11-18 16:52:33 838 [Warning] /usr/sbin/mysqld: Forcing close of thread 6  user: 'eximstats'
    2014-11-18 16:52:31 838 [Note] /usr/sbin/mysqld: Normal shutdown
    2014-11-18 16:51:34 838 [Note] /usr/sbin/mysqld: ready for connections.
    141118 16:51:33 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141117 18:14:51 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    2014-11-17 18:14:51 27969 [Note] /usr/sbin/mysqld: Shutdown complete
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Do you notice any additional error messages in /var/lib/mysql/$hostname.err at the time of the failure? Do you have any third-party applications (e.g. process resource monitors) installed that could be restarting MySQL?

    Thank you.
     
  3. zlesavich

    zlesavich Member

    Joined:
    Aug 11, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator

    All I had was Softaculous, but I've removed it. It wasn't affecting this service though. I don't have a $hotname.pid file though. It's a $hostname.err file. Everytime I change it to .pid or make a new .pid file, it just ends up getting deleted!!!!! Here's the contents of my $hostname.err file.

    Code:
    141120 20:07:40 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141120 20:07:40 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141120 20:10:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141120 20:10:08 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141120 20:15:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141120 20:15:10 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141120 20:20:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141120 20:20:08 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141120 20:21:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141120 20:21:36 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141120 20:22:44 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    @
    
     
  4. 24x7ss

    24x7ss Well-Known Member

    Joined:
    Sep 30, 2014
    Messages:
    271
    Likes Received:
    16
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    I will suggest you to remove the pid file and then start mysql service or first kill or mysql process and then try it. pid file gets automatically created by mysql there is no need to create it manually.

    If still not working then Check that all directory with MySQL database is owned by mysql user.
     
  5. triantech

    triantech Well-Known Member

    Joined:
    Jul 1, 2014
    Messages:
    145
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Kochi, India, India
    cPanel Access Level:
    Root Administrator
    Hey,

    what are your server specs ? Make sure you have enough disk space as well !
     
  6. 24x7ss

    24x7ss Well-Known Member

    Joined:
    Sep 30, 2014
    Messages:
    271
    Likes Received:
    16
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    I would suggest you to tail the mysql error log file and try restarted mysql if it continues to fail. Most common reasons behind mysql failures are diskspace/inodes or the InnoDB engine crash. But surely you want to tail the logs and try restarting the service and provide logs what you get.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The /var/lib/mysql/$hostname.err file is normal. It's your MySQL error log. You should not remove or rename it. Could you post the contents of your /etc/my.cnf file in CODE tags?

    Thank you.
     
  8. zlesavich

    zlesavich Member

    Joined:
    Aug 11, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Here they are

    Code:
    [mysqld]
    innodb_file_per_table=1
    open_files_limit=10000
    max_allowed_packet=268435456
    default-storage-engine=MyISAM
    innodb_buffer_pool_size=134217728
    ~
    
     
  9. zlesavich

    zlesavich Member

    Joined:
    Aug 11, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    This is very strange. Now the service recovers itself kind of but crashes again in another 4 minutes. Here's what the recovery email says:

    Code:
     	
    
    2014-11-24 19:18:05 1533 [Note] /usr/sbin/mysqld: ready for connections.
    141124 19:18:00 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    141124 19:17:48 mysqld_safe mysqld from pid file /var/lib/mysql/server2.domain.net.pid ended
    141124 19:17:40 mysqld_safe mysqld restarted
    141124 19:17:40 mysqld_safe Number of processes running now: 0
    2014-11-24 19:17:28 1152 [Note] /usr/sbin/mysqld: ready for connections.
    141124 19:17:17 mysqld_safe mysqld restarted
    141124 19:17:17 mysqld_safe Number of processes running now: 0
    2014-11-24 19:16:44 770 [Note] /usr/sbin/mysqld: ready for connections.
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  11. zlesavich

    zlesavich Member

    Joined:
    Aug 11, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I did post that earlier. But I no longer care. After a ticket with cPanel support, I found out InnoDB was corrupted. The support rep did a manual restart of MySQL and it finally worked, but some data was lost. Good thing I had the backups :)
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page