I used this command from shell to repair all Databases

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

and after that I restarted the server

when it came back alive again I tried to open my vBulletin forum but I recived Database error message.

and also tried to open phpMyAdmin but I received this error :

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured).

I checked the services list and found that the MySQL Service is not listed, so I tried to start it from shell I receive this error :

Starting MySQL.Manager of pid-file quit without updating fi[FAILED]

could anyone help me in that ?

thanks in advance.


I found these lines in the log file

101101 01:36:01 mysqld started
101101 1:36:01 [Warning] Asked for 196608 thread stack, but got 126976
101101 1:36:01 [ERROR] /usr/sbin/mysqld: Table './mysql/user' is marked as crashed and last (automatic?) repair failed
101101 1:36:01 [ERROR] /usr/sbin/mysqld: Table './mysql/user' is marked as crashed and last (automatic?) repair failed
101101 1:36:01 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/user' is marked as crashed and last (automatic?) repair failed
101101 01:36:01 mysqld ended

What should I do then ?

  • What about in error log? – user58824 Nov 1 '10 at 5:12
  • Where Could I find it Gennady ? – Mohamed Nour El-Din Nov 1 '10 at 5:28
  • sudo less /var/log/mysql.err or sudo less /var/log/mysql.log or sudo less /var/log/syslog I have messages from mysql in the syslog file. – user58824 Nov 1 '10 at 8:39

This occurs when mysqld is not properly shutdown. Basically, the pid file--a file that contains the process id of the currently running process--exists to detect whether or not the process is actively running. When the system is out of whack--i.e., it found the pid but can't find the process, meaning the server was not stopped correctly--it requires manual intervention.

Simply rm /var/run/mysqld.pid and you should be fine.


UPDATE: Based on your recent log files (and the fact that automatic repairs failed), here's a great post on additional repair methods. Additionally, make sure you have enough disk space on the server.


Try starting mysqld with --skip-grant-tables so it won't try to load the (crashed) user table.

/etc/init.d/mysqld start --skip-grant-tables

then log into mysql


then try the repair command on the user table

use mysql; 

I'm not sure that syntax is 100% correct.

  • for me: /etc/init.d/mysql start --skip-grant-tables – Sadee May 18 '16 at 10:22

I think you need mysqlrepair:

mysqlrepair -r tablename

(Just realized this is the same as mysqlcheck.)

What you need is explicit repair instead of autorepair.


Problem solved :)

Thanks cstamas, Resorath, Andrew & Gennady, thanks all for your help :)

I tried this from shell, and it worked just fine:

service mysql stop 
mkdir /home/tmp
cd /var/lib/mysql
myisamchk --tmpdir=/home/tmp -r */*.MYI
service mysql start
  • Glad we could help! :) – Andrew M. Nov 1 '10 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.