Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having trouble restarting mysql. When I enter the following command, I get this message:

# /etc/init.d/mysql restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart mysql

And it hangs forever.

When I try to restart mysql as a service using the following command:

# service mysql restart

It hangs forever.

I can't log into mysql as root anymore either. Any ideas on how to get this running again?

I tried the following

# service mysql start
start: Job is already running: mysql

When I do the following

# ps -ef | grep -i mysql | grep -v grep

Nothing gets returned

share|improve this question
Please check if your disk is not full – Sergei Jan 2 '12 at 20:29
The disk is not full – user784637 Jan 2 '12 at 20:30
Did you try a reboot? Maybe hangs the pid file? – Dennis Wisnia Jan 2 '12 at 21:00
I already tried rebooting the server. Same problem still – user784637 Jan 2 '12 at 21:05

Check the MySQL logs in /var/log or possibly in /var/lib/mysql.

My bet is that the reason it "hangs" is because its doing a repair of some sort on tables that could have gotten corrupted. I've seen "mysql" take 20 minutes or longer to "start"... How long have you given it before assuming it's "hung"?

See if the logs indicate anything. Also, after starting mysql once, try running this to verify MySQL is, in fact, running:

ps aux | grep mysql
share|improve this answer
Thanks for your suggestions, but look at the last line I wrote with the ps -ef, nothing gets returned even after I 'start' mysql – user784637 Jan 2 '12 at 20:51
Have you checked the logs? – David W Jan 2 '12 at 20:54
Yah, nothing special – user784637 Jan 2 '12 at 20:58
Where can I can the mysqld.sock? It's missing from /var/run/mysqld – user784637 Jan 2 '12 at 21:01

The best way to debug this type of thing is to directly run

sudo mysqld

That's the only way to see startup errors. (For some reason, they aren't written to any of the mysql logs). Often you can see it's failing to load a binlog or having problems getting to a certain directory.

share|improve this answer
You sure that sudo belongs there?! – Bobby Jul 11 '12 at 9:20
running this without sudo will give you more accurate feedback unless you are launching mysqld as sudo. MySQL has global and user specific settings, so sudo would only give you information for the root user. – Tisch Feb 27 at 15:11

Your Answer


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.