Table './mysql/user' is marked as crashed and should be repaired

Discussion in 'General' started by ikrudolf, Aug 27, 2015.

  1. ikrudolf

    ikrudolf Member

    But how can I repair when mysql failes to start?
    This doesn't work as well: /etc/init.d/mysql start --skip-grant-tables
    Any tips/suggestions?
  2. spillerm

    spillerm New Member


    not /etc/init.d/mysql start --skip-grant-tables, but

    sudo /usr/bin/mysqld_safe --skip-grant-tables &

    or something like that. Are there any messages in the logfiles?

  3. ikrudolf

    ikrudolf Member

    I get this:

    root@h2:~# sudo /usr/bin/mysqld_safe --skip-grant-tables &
    [1] 9211
    root@h2:~# 150827 22:34:16 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
    150827 22:34:16 mysqld_safe Logging to '/var/log/mysql/error.log'.
    150827 22:34:16 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    150827 22:34:16 mysqld_safe mysqld from pid file /var/run/mysqld/ ended
    [1]+ Done sudo /usr/bin/mysqld_safe --skip-grant-tables

    Which logs should I check?
    MySQL is still not running :-(
    Last edited: Aug 27, 2015
  4. ikrudolf

    ikrudolf Member

    Tried this:
    service mysql stop
    mkdir /home/tmp
    cd /var/lib/mysql
    myisamchk --tmpdir=/home/tmp -r */*.MYI
    service mysql start

    It fixes some things but :-(
    root@h2:/var/lib/mysql# service mysql start
    start: Job failed to start
  5. ikrudolf

    ikrudolf Member

    And this but :-(
    root@h2:/var/lib/mysql# myisamchk -r -v -f ./mysql/user
    - recovering (with sort) MyISAM-table './mysql/user'
    Data records: 214
    - Fixing index 1
    - Searching for keys, allocating buffer for 616 keys
    - Dumping 214 keys
    root@h2:/var/lib/mysql# service mysql start
    start: Job failed to start
  6. ikrudolf

    ikrudolf Member

    I think I have it solved... :)
    I saw many innodb errors in /var/log/mysql/error.log

    [mysqld] innodb_force_recovery =4
    till likes this.
  7. ikrudolf

    ikrudolf Member

    Repaired mysql/user table from phpmyadmin
    When I remove: innodb_force_recovery =4 from /etc/mysql/my.cnf mysql still not starting

    150831 10:31:05 InnoDB: Waiting for the background threads to start
    150831 10:31:06 InnoDB: 5.5.41 started; log sequence number 5117549468110
    150831 10:31:06 InnoDB: !!! innodb_force_recovery is set to 4 !!!
    150831 10:31:06 [Note] Server hostname (bind-address): ''; port: 3306
    150831 10:31:06 [Note] - '' resolves to '';
    150831 10:31:06 [Note] Server socket created on IP: ''.
    150831 10:31:06 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. The table is probably corrupted
    150831 10:31:06 [ERROR] mysql.user has no `Event_priv` column at position 29
    150831 10:31:06 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
    150831 10:31:06 [Note] /usr/sbin/mysqld: ready for connections.
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you try to run a repair on all databases with phpmyadmin?

Share This Page