debugsqlMinor
Can't open the mysql.plugin table error when installing MySQL on Mac OS Sierra
Viewed 0 times
cantheerroropenmysqlplugininstallingwhenmactable
Problem
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
This is how I initialised MySQL:
When I start MySQL with homebrew I get no error:
Version info:
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] AbortingThis is how I initialised MySQL:
mysqld -initialize --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysqlWhen 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 wrapperSolution
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:
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:
This had unfortunately altered the file permissions within /usr/local/mysql within /usr/local, causing the error.
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 THISThis had unfortunately altered the file permissions within /usr/local/mysql within /usr/local, causing the error.
Code Snippets
sudo chown -R mysql /usr/local/mysql/*sudo chown -R $(whoami):admin /usr/local # DO NOT DO THISContext
StackExchange Database Administrators Q#181630, answer score: 2
Revisions (0)
No revisions yet.