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 is not running

Discussion in 'Database Discussions' started by YasIT, May 6, 2014.

  1. YasIT

    YasIT Active Member

    Joined:
    Jan 3, 2014
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hello.

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

    root@server [/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!

    root@server [/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 - - -

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

    cPanelMichael Forums Analyst
    Staff Member

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

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

    Try using this command to repair it:

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

    YasIT Active Member

    Joined:
    Jan 3, 2014
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    root@server [~]# 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
    root@server [~]# service mysql start
    Starting MySQL......The server quit without updating PID file (/var/lib/mysql/hostname.pid). [FAILED]
    root@server [~]#


    root@bazdid [/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
     
  4. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
  5. YasIT

    YasIT Active Member

    Joined:
    Jan 3, 2014
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page