问题
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.
- Run
ps -ef | grep mysql
- Using the value from the second column (the pid):
sudo kill <pid>
- In the event that that isn't enough to kill it then:
sudo kill -12 <pid>
- 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