mysql wont stop, mysqld_safe appeared in top

my server (CentOS) contains lots of website, which collect data from lots of sources with cron. the mysql config is the default

recently, PHP failed to communicate with mysql. Firstly I just restart the server

but after restarted, PHP still failed to communicate with mysql

I've tried:

ps ax | grep mysql

Then run: kill -9 #### (I've also tried killall -9 ####) - this failed, ps ax | grep mysql showing the killed process id is still there

service mysqld start (I've also tried /etc/init.d/mysqld start) - I got reply Timeout error occurred trying to start MySQL Daemon.

when run top, mysqld_safe is appeared on top with about 50% of CPU usage. I dont know the size of all the database.

I really confused


Remember, mysqld_safe IS NOT MYSQL. It has a loop in it to call mysqld, the actual server daemon process. It was probably looping itself silly trying to start up mysqld. That was all the problem was.

You should always

  • make sure the socket file from the last time mysqld ran is gone.
  • check the mysql error log after a failed startup.

I think it is a hardware problem or at least the HDD is very slow. Can you please paste the /proc//status content? Can you run also dmesg and paste the last 20 lines?