通过brew安装的MySQL 5.7现在出现错误!服务器退出而不更新PID文件(/usr/local/var/mysql/dev_box.local.pid) [英] MySQL 5.7 installed via brew now getting ERROR! The server quit without updating PID file (/usr/local/var/mysql/dev_box.local.pid)

查看:266
本文介绍了通过brew安装的MySQL 5.7现在出现错误!服务器退出而不更新PID文件(/usr/local/var/mysql/dev_box.local.pid)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前有mysql版本8,由于某些依赖性,我不得不降级到5.7,因此通过brew安装了mysql@5.7.

I had mysql version 8 earlier, due to some dependency i had to downgrade to 5.7 so installed mysql@5.7 via brew.

步骤

brew uninstall mysql
brew install mysql@5.7
mysql.server start
brew link mysql@5.7 --force

现在,一旦我停止了服务器,现在我想重新启动它,但是我得到了

Now once i have stopped the server and now i want to restart it but i am getting

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

当我这样做

mysqld --initialize

我得到

[ERROR] --initialize specified but the data directory has files in it. Aborting.
[ERROR] Aborting

但是,当我尝试使用服务启动服务器时,服务器正在启动,但是我没有在grep中得到任何信息,但是当我执行酿造服务列表"时,则表明服务器已启动. 但我无法登录

But when i try to start the server using services it's starting but i am not getting anything in the grep but when i do "brew services list" it's showing that server is started. but i am not able to login

mysqladmin -u root password 'password'

这给出了错误

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

我已经尝试了

MySql服务器启动错误'服务器退出而不更新PID文件'

通过Brew安装MySQL之后,出现错误-服务器退出而不更新PID文件

没有运气,希望能获得一些快速的帮助.

With no luck, hoping for some quick help.

推荐答案

我遇到了同样的情况.帮助我的是:

I had the same situation. What helped me is:

首先使用brew卸载mysql

First uninstall mysql using brew

brew uninstall mysql
brew uninstall mysql@5.7

然后手动浏览/usr/local/中的所有文件夹,并删除与mysql相关的所有内容.

Then manually go through all folders in /usr/local/ and delete everything related to mysql.

例如,我有/usr/local/etc/my.cnf和my.cnf.default,因此必须运行rm -f /usr/local/etc/my*;还有/usr/local/mysql-5.7.21-macos10.13-x86_64和mysql-8.0.16-macos10.14-x86_64,所以rm -rf /usr/local/mysql*依此类推.

For example, I had /usr/local/etc/my.cnf and my.cnf.default, so had to run rm -f /usr/local/etc/my*; also /usr/local/mysql-5.7.21-macos10.13-x86_64 and mysql-8.0.16-macos10.14-x86_64, so rm -rf /usr/local/mysql* and so on.

完成后,使用brew安装

After this is done install using brew

brew install mysql@5.7
brew services start mysql@5.7

这篇关于通过brew安装的MySQL 5.7现在出现错误!服务器退出而不更新PID文件(/usr/local/var/mysql/dev_box.local.pid)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆