3

I am attempting to install MySQL on macOS Sierra 10.12.5. I had a previous (non-functioning) install of MySQL so I followed the steps here to install a clean copy with Homebrew.

I had to create a var/log/mysql/error.log as it wasn't created automatically, however now it is logging I get the following error when I do a mysql.server start:

2017-07-24T13:36:28.554840Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2017-07-24T13:36:28.563492Z 0 [ERROR] unknown variable 'key_buffer=16M'
2017-07-24T13:36:28.563534Z 0 [ERROR] Aborting

This is how I initialised MySQL:

mysqld -initialize --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql

When I start MySQL with homebrew I get no error:

CRMPiccos-MacBook:~ crmpicco$ brew services start mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)

Version info:

CRMPiccos-MacBook:log crmpicco$ mysql --version
mysql  Ver 14.14 Distrib 5.7.19, for osx10.12 (x86_64) using  EditLine wrapper
2
  • This means that mysql is up and running, but with entries in the error.log?
    – John K. N.
    Aug 23, 2017 at 13:45
  • @hot2use I'm not following you.
    – crmpicco
    Aug 24, 2017 at 13:28

1 Answer 1

2

In my case mysql failed after the update because the user running mysqld (The user mysql) being unable to open the mysql data directory with write permission. The files were instead owned by myself. I fixed this with:

sudo chown -R mysql /usr/local/mysql/*

The orignal cause (for me) was not the Sierra upgrade itelf, but the overall process of updating applications in response. Specifically other instructions online for updating PHP with brew after the Sierra update had included a chown:

sudo chown -R $(whoami):admin /usr/local # DO NOT DO THIS

This had unfortunately altered the file permissions within /usr/local/mysql within /usr/local, causing the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.