MySQL Service Won't Start

  • Thread starter Deleted member 568311
  • Start date
D

Deleted member 568311

Guest
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
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.
 
D

Deleted member 568311

Guest
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.

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
@
 

24x7ss

Well-Known Member
Sep 30, 2014
272
19
68
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.
 

24x7ss

Well-Known Member
Sep 30, 2014
272
19
68
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
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.
 
D

Deleted member 568311

Guest
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
~
 
D

Deleted member 568311

Guest
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
Could you post the output from /var/lib/mysql/$hostname.err when it fails?

Thank you.
 
D

Deleted member 568311

Guest
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 :)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
I am happy to see the issue is now addressed. Thank you for updating us with the outcome.