MySql 错误!服务器退出而不更新PID文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35026553/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 21:34:16  来源:igfitidea点击:

MySql ERROR! The server quit without updating PID file

mysql

提问by JFQue3316

I inherited a computer that previously had MySql server installed and then uninstalled (apparently, it ran fine before the uninstall). I am in Database class, so I tried to install it again and now I get the error:

我继承了一台以前安装了 MySql 服务器然后卸载的计算机(显然,它在卸载之前运行良好)。我在数据库类中,所以我尝试再次安装它,现在出现错误:

Starting MySQL . ERROR! The server quit without updating PID file (/usr/local/mysql/data/Computer.local.pid).

启动 MySQL。错误!服务器退出而不更新 PID 文件 (/usr/local/mysql/data/Computer.local.pid)。

I looked online and saw this error happened to others, but either a)I couldn't figure out how to do the fix or b)the fix didnt work for me.

我在网上查看并看到其他人发生了此错误,但是 a) 我不知道如何进行修复或 b) 修复对我不起作用。

I tried(from http://coolestguidesontheplanet.com/mysql-error-server-quit-without-updating-pid-file/):

我试过(来自http://coolestguidesontheplanet.com/mysql-error-server-quit-without-updating-pid-file/):

Computer:/ computer$ /usr/local/mysql/support-files/mysql.server restart

计算机:/ computer$ /usr/local/mysql/support-files/mysql.server restart

And I get this error: ERROR! MySQL server PID file could not be found! Starting MySQL

我收到此错误: 错误!找不到 MySQL 服务器 PID 文件!启动 MySQL

. ERROR! The server quit without updating PID file (/usr/local/mysql/data/Computer.local.pid).

. 错误!服务器退出而不更新 PID 文件 (/usr/local/mysql/data/Computer.local.pid)。

I am not sure what they are telling me to do here:

我不确定他们要我在这里做什么:

Remove /etc/my.cnf or just back it up for now and restart: sudo mv /etc/my.cnf /etc/my.cnf.bak

删除 /etc/my.cnf 或暂时备份并重新启动: sudo mv /etc/my.cnf /etc/my.cnf.bak

because I get this error when I type:

因为我在键入时收到此错误:

Computer:/ computer$ cd /usr/my.cnf

计算机:/ computer$ cd /usr/my.cnf

-bash: cd: /usr/my.cnf: No such file or directory

-bash: cd: /usr/my.cnf: 没有那个文件或目录

I also see from: mysql ERROR! The server quit without updating PID file?That there are error logs and the my.cnf file, but I am not sure to access them.

我也看到了:mysql ERROR!服务器退出而不更新PID文件?有错误日志和 my.cnf 文件,但我不确定是否可以访问它们。



The MySql I downloaded: mysql-5.7.10-osx10.9-x86_64.dmg

我下载的MySql:mysql-5.7.10-osx10.9-x86_64.dmg

I am on a mac version 10.7.5

我在 Mac 版本 10.7.5

Thanks!

谢谢!

回答by Big Data DBA

Mostly this is a permission issue

这主要是一个权限问题

Step1:Check the error file first.

Step1:首先检查错误文件。

tail -f /usr/local/mysql/data/*.err

Step2:Do a complete shut down or kill the process. Confirm that no mysql process is running

步骤2:完全关闭或终止进程。确认没有mysql进程在运行

mysqladmin -uroot shutdown
sudo killall mysqld 

ps -ef | grep mysql

Step3:Give permisiions

Step3:授予权限

sudo chown -RL root:mysql /usr/local/mysql
sudo chown -RL mysql:mysql /usr/local/mysql/data
chmod -R 755 /usr/local/mysql/data

Step4:Start mysql

第四步:启动mysql

sudo mysql.server start