Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.


update

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 ?

share|improve this question
    
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

4 Answers 4

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.

Andrew

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.

share|improve this answer
    
thanks Andrew, but it still not working ): –  Mohamed Nour El-Din Nov 1 '10 at 8:16

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

mysql

then try the repair command on the user table

use mysql; 
REPAIR TABLE user;

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

share|improve this answer

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.

share|improve this answer

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
share|improve this answer
    
Glad we could help! :) –  Andrew M. Nov 1 '10 at 12:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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