YasIT

Active Member
Jan 3, 2014
38
0
6
cPanel Access Level
Root Administrator
Hello.

[email protected] [/var/lib/mysql]# service mysql status
MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED]
[email protected] [/var/lib/mysql]#

[email protected] [/var/lib/mysql]# tail -f hostname.err
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting-datadict.h tml
InnoDB: for how to resolve the issue.
140507 0:02:06 InnoDB: Waiting for the background threads to start
140507 0:02:07 InnoDB: 5.5.36 started; log sequence number 70702761909
140507 0:02:07 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140507 0:02:07 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140507 0:02:07 [Note] Server socket created on IP: '0.0.0.0'.
140507 0:02:07 [ERROR] /usr/sbin/mysqld: Table './mysql/db' is marked as crashe d and should be repaired
140507 0:02:07 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/db' is marked as crashed and should be repaired
140507 00:02:07 mysqld_safe mysqld from pid file /var/lib/mysql/hostname.pid ended

/var/lib/mysql/hostname.pid not found!

[email protected] [/var/lib/mysql]# service mysql start
Starting MySQL....The server quit without updating PID file (/var/lib/mysql/hostname.pid).

in cPanel :

The MySQL server is currently offline.
Error while connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). Error from MySQL query: Can't call method "do" on an undefined value at /usr/local/cpanel/Cpanel/Mysql.pm line 1196, <STDIN> line 1.

please help.

- - - Updated - - -

[email protected] [/var/lib/mysql]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello :)

The following message in your MySQL error log is the source of this issue:

Table './mysql/db' is marked as crashed and should be repaired
Try using this command to repair it:

Code:
myisamchk /var/lib/mysql/mysql/db.MYI
Thank you.
 

YasIT

Active Member
Jan 3, 2014
38
0
6
cPanel Access Level
Root Administrator
[email protected] [~]# myisamchk /var/lib/mysql/mysql/db.MYI
Checking MyISAM file: /var/lib/mysql/mysql/db.MYI
Data records: 26734 Deleted blocks: 0
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1
- check data record references index: 2
[email protected] [~]# service mysql start
Starting MySQL......The server quit without updating PID file (/var/lib/mysql/hostname.pid). [FAILED]
[email protected] [~]#


[email protected] [/var/lib/mysql]# tail -f hostname.err
/usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x48)[0x5a60d8]
/usr/sbin/mysqld[0x6e3771]
/usr/sbin/mysqld(_Z11plugin_initPiPPci+0xbc6)[0x6e72b6]
/usr/sbin/mysqld[0x59902d]
/usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x415)[0x59dfe5]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3c9181ed1d]
/usr/sbin/mysqld[0x5905ed]
The manual page at MySQL :: MySQL 5.6 Reference Manual :: C.5.4.2 What to Do If MySQL Keeps Crashing contains
information that should help you find out what is causing the crash.
140507 04:57:39 mysqld_safe mysqld from pid file /var/lib/mysql/hostname.pid ended
 

cPanelPeter

Senior Technical Analyst
Staff member
Sep 23, 2013
585
25
153
cPanel Access Level
Root Administrator
Hello,

The myisamchk program has an additional flag for repair. Try:

Code:
# myisamchk -r /var/lib/mysql/mysql/db.MYI
Without the -r flag, it's just a check and won't actually repair the file.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
I am happy to see you were able to resolve the issue. Thank you for updating us with the outcome.

Note that removing the ib_logfile files is not necessarily a step everyone should take. Administrators should investigate and ensure it won't result in potential data loss.

Thank you.