OS X上的MySQL 5.7.9 El Capitan:错误服务器退出而不更新PID文件

问题描述 投票:5回答:3

我有一台带有OS X Yosemite的Mac Pro服务器,几天前我们升级到OS X El Capitan。当我尝试重新安装MySQL时出现问题。我进入官方MySQL页面并在DMG包中下载最新版本(5.7.9)并正常安装。 安装并重新启动服务器后,MySQL服务器没有自动启动,当手动启动时,我得到:

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

我一直在互联网上尝试很多解决方案:

After MySQL install via Brew, I get the error - The server quit without updating PID file

http://coolestguidesontheplanet.com/mysql-error-server-quit-without-updating-pid-file/

PID error on mysql.server start?

MySQL pid ended (cannot start mysql)

我尝试使用mysql.server restart,重启服务器。删除*.err文件,我也尝试创建自己的PID文件,但它被自动删除。

一个可能的解决方案是完全卸载MySQL并重新安装:http://bytearrays.com/completely-uninstall-mysql-mac-osx/

另一个是修改.plist,但这个文件与提供的解决方案相同,所以它无法解决我的问题。

而且我仍然无法启动MySQL服务器。

我认为有两种可能性:一方面可能是我没有完全卸载MySQL而且有些东西做坏事另一方面是/etc/my.cnf文件的使用是问题所在。

我已经被困了2天了。我不知道如何运行服务器。

编辑1:执行sudo mysqld --user=mysql的输出是:

simidat-apps:~ admin$ sudo mysqld --user=mysql
Password:
2015-11-18  9:08:36 140735160397824 [Note] mysqld (mysqld 10.1.8-MariaDB) starting as process 81030 ...
2015-11-18  9:08:36 140735160397824 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2015-11-18  9:08:36 140735160397824 [ERROR] mysqld: File '/usr/local/var/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
2015-11-18  9:08:36 140735160397824 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/usr/local/var/mysql/aria_log_control'
2015-11-18  9:08:36 140735160397824 [ERROR] Plugin 'Aria' init function returned error.
2015-11-18  9:08:36 140735160397824 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Memory barrier is not used
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Compressed tables use zlib 1.2.5
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Using CPU crc32 instructions
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-11-18  9:08:36 140735160397824 [Note] InnoDB: Completed initialization of buffer pool
2015-11-18  9:08:36 140735160397824 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
2015-11-18  9:08:36 140735160397824 [ERROR] InnoDB: The system tablespace must be writable!
2015-11-18  9:08:36 140735160397824 [ERROR] Plugin 'InnoDB' init function returned error.
2015-11-18  9:08:36 140735160397824 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-11-18  9:08:36 140735160397824 [Note] Plugin 'FEEDBACK' is disabled.
2015-11-18  9:08:36 140735160397824 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2015-11-18  9:08:36 140735160397824 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-11-18  9:08:36 140735160397824 [ERROR] Aborting

我忘了把这个错误放在最初的问题上,这似乎是InnoDB上的一个错误(我不知道它是什么,如果有人能解释我是什么,我会非常感激)。我也在互联网上寻找这个错误,我不记得我在哪里看到了解决方案,但我必须删除每个InnoDB日志文件(ib*files),令人惊讶的是我找不到任何日志文件,所以我无法删除任何内容。我认为这可能是一个权限问题,但对哪些用户有什么权限?

mysql macos server pid osx-elcapitan
3个回答
3
投票

你的问题实际上不是Mysql,而是MariaDB的方案。问题是aria_log_control文件的权限。

我通过brew安装了mysql / mariadb,因此我:

  1. 将perms重置为775(sudo chmod 775 / usr / local / var / mysql / aria_log_control`)
  2. 删除了日志文件(例如rm /usr/local/var/mysql/*.home.err
  3. 启动/停止mysqld

Other sources声称你需要删除mysql目录。对我来说情况并非如此。


0
投票

根据qazxsw i,将mysql用户更改为您的用户: -

创建the answer listed on github

并添加以下行: -

/usr/local/etc/my.cnf.d/user.cnf

OSX Sierra 10.12.1 / MariaDB 10.1.19

[mysqld] user=YOUR_USER_NAME

(我尝试更改https://github.com/Homebrew/legacy-homebrew/issues/50670文件的权限,但这些在重新启动后无法生存)。


0
投票

另一件要检查的是mysql数据目录上的所有父目录的权限是正确的。

对于前者检查/ var上的权限是否正确,以及/ var / lib /上的权限是否正确。

在我的情况下,我的/ var权限搞砸了,用户“mysql”根本无法访问var目录。

检查这一点的一种方法是切换到普通用户,并确保普通用户可以cd到/ var和/ var / lib(假设mysql数据目录在/ var / lib中)。

© www.soinside.com 2019 - 2024. All rights reserved.