MySQL不会关闭:“停止服务器:错误!找不到MySQL服务器PID文件!

MySQL不会关闭:“停止服务器:错误!找不到MySQL服务器PID文件!

问题描述:

初学者在这里!昨天,我已启动服务器并运行并正常运行,但是今天我无法连接到我的站点.我试图关闭MySQL服务器,但出现了ff错误

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

停止服务器:错误!找不到MySQL服务器PID文件!

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

服务器正在使用MySQL Workbench运行.公平地说,我昨天使用的是MySQL Preference Pane和/或命令行

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

我在网上看到了很多解决方案,所有解决方案都大不相同.我尝试了些无济于事. (而且,我什至不知道PID文件在哪里以及在哪里...)有什么建议吗?预先谢谢你!

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!

您可以尝试使用kill命令将其杀死.

You could attempt to kill it with the kill command.

  1. 运行ps -ef | grep mysql
  2. 使用第二列(pid)中的值:sudo kill <pid>
  3. 如果这还不足以杀死它,那么:sudo kill -12 <pid>
  4. 如果那之后不起作用,最后:sudo kill -9 <pid>
  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>

最后一个进程杀死了进程,但没有向进程的子进程发出信号,表明进程已被杀死,但这肯定会完成任务.运行每一个之后,只需运行ps -ef | grep mysql来查看它是否仍然挂起.如果必须使用kill -9,则一定要运行ps -ef | grep mysql并手动杀死所有子级,然后再重新启动服务器.

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.

最后,真正的问题是您的pid文件发生了什么?如果再次发生这种情况,您应该花一些时间进行调查,因为那里有些古怪.

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.