[mysql error]The server quit without updating PID file
update: 2017年7月11日17:42
终极解决方案:
用brew安装mysql经常会碰到这些问题,直接用安装包安装后,从未复现
debug前须知:
mysql配置文件依次读取:
网上提供的解决方法:
查看报错信息,有两处报错
err文件位于/usr/local/var/mysql/data
- Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
按照提示运行`mysql_upgrade`报错
>mysql_upgrade: Got error: 2002: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
- Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
检查是否有实例正在运行
|
|
结果:没有
删除.err文件
结果:无效
改变权限
|
|
结果:无效
重新初始化
|
|
因为/usr/local/var/mysql/data目录不为空,所以没法初始化,那么先清空目录,再初始化
|
|
再运行sudo mysql.server start
命令启动,依然报错,查看目录文件权限,原来初始化的时候又改变权限了
|
|
DONE!
brew services start mysql与mysql.server start
2017-04-12T12:00:55.701485Z 1 [Note] A temporary password is generated for root@localhost: ZCBp1r-K0RlE
If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.
本文作者 : 小凡
原文链接 : https://16bh.github.io/2017/04/12/mysql-error-The-server-quit-without-updating-PID-file/
版权声明 : 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!