PID error on mysql.server start?

2019-01-08 12:26发布

I've just tried installing MySQL using homebrew (on Mac OS X 10.6), but I've run across an issue at the first hurdle. When trying to manually start the server (mysql.server start), I get the following error:

. ERROR! Manager of pid-file quit without updating file.

Unfortunately I'm not sure of which error logs or configuration files to check, as I've never installed MySQL in this way before.

7条回答
不美不萌又怎样
2楼-- · 2019-01-08 13:21

I am adding this here because I encountered this problem several times after installing other software. MySQL was working fine for days, then suddenly I get this error.

It seems to happen when I install something (eg. elasticsearch or Puma web server). The MySql permissions get reverted again (back to me, and not _mysql). No idea why.

  • MacOS Sierra
  • Homebrew 1.0.5-43-g41b2df8 (2016-10-02)
  • MySQL 5.7.15

So I have found that one cause of this is the permissions on the location where MySQL stores your databases, which by default is here:

/usr/local/var/mysql

If you look in that folder you will see a file

<your computer name>.err

If you look inside that file (more it or cat it) you will probably see this error:

[ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable

If so then you know it is a permissions issue.

If you don't care, you can probably just run MySQL by just running mysqld (and leave that terminal open).

If you do care:

ls -al /usr/local/var/mysql

you will notice that the permissions are probably all set to you (your user account). This means mysql cannot mount your databases when you run it using the homebrew shortcut sudo mysql.server start [even though you are using sudo to run in 'admin' mode].

So, change the permissions:

$ sudo chown -R _mysql /usr/local/var/mysql
$ sudo chmod -R o+rwx /usr/local/var/mysql

Then it will work.

查看更多
登录 后发表回答