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

How to make mysql service online from crash!


mysqld started
[ERROR] /usr/sbin/mysqld: Table './mysql/user' is marked as crashed and should be repaired
[ERROR] /usr/sbin/mysqld: Table './mysql/user' is marked as crashed and should be repaired
[ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/user' is marked as crashed and should be repaired
mysqld ended

Which means DB: /var/lib/mysql/mysql table: "user" has been crashed.

To resolve this issue, please perform the commands below:

root@ranjith [/var/lib/mysql/mysql]# service mysql start --skip-grant-tables

now with mysql started, you can repair the mysql/user table

root@ranjith [/var/lib/mysql/mysql]# mysqlcheck -r mysql user

or

Repair ALL database tables thorugh:

http://techietent.blogspot.in/2013/02/how-repair-all-database-tables.html

After that,

root@ranjith [/var/lib/mysql/mysql]# service mysql stop

Shutting down MySQLs [ OK ]
root@ranjith [/var/lib/mysql/mysql]# service mysql start
Starting MySQL [ OK ]
root@ranjith [/var/lib/mysql/mysql]#

cheers!!!

Comments

  1. Thanks a million. This is a lifesaver!

    ReplyDelete
  2. Great article, we provide wordpress management services and have recommended this article to many of your clients. Great post and it works!

    ReplyDelete

Post a Comment

Popular posts from this blog

Resolved: DOCKER: Error response from daemon: Could not attach to network / rpc error: code = 7 desc = network not manually attachable.

yum failed 6 times. Cannot continue!

How to echo colored text in linux shell script: