PID error on mysql.server start?

后端 未结 7 1460
名媛妹妹
名媛妹妹 2020-12-01 03:19

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.serve

相关标签:
7条回答
  • 2020-12-01 04:14

    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.

    0 讨论(0)
提交回复
热议问题