MySQL won't shutdown: “Stop server: ERROR! MySQL server PID file could not be found!”

五迷三道 提交于 2020-01-02 20:44:14

问题


Beginner here! I had the server up and running and functioning yesterday, but today I can't connect to my site. I tried to shutdown the MySQL server but the ff error was given

Stop server: ERROR! MySQL server PID file could not be found!

The server is running using MySQL Workbench. To be fair, I was using the MySQL Preference Pane and/or the command line yesterday

sudo /usr/local/mysql/support-files/mysql.server start

I've seen many kinds of solutions online, all very different. I've tried some to no avail. (Also, I don't even know what and where the PID file is...) Any suggestions? Thank you in advance!


回答1:


You could attempt to kill it with the kill command.

  1. Run ps -ef | grep mysql
  2. Using the value from the second column (the pid): sudo kill <pid>
  3. In the event that that isn't enough to kill it then: sudo kill -12 <pid>
  4. In the event that doesn't work then, finally: sudo kill -9 <pid>

That last one kills the process, but doesn't signal to the process's children that the process was killed, but it will definitely do the job. After running each one just run that ps -ef | grep mysql to see if it's still hanging on. If you have to resort to kill -9 then definitely run ps -ef | grep mysql and manually kill off any children before restarting the server.

In the end, the real question is what happened to your pid file? If it happens again this is something you should spend some time investigating because something is wonky there.



来源:https://stackoverflow.com/questions/33390936/mysql-wont-shutdown-stop-server-error-mysql-server-pid-file-could-not-be-fo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!