Why is Homebrew running MySQL service as root and how to change it?
I used brew update
brew upgrade mysql
to bump version from 8.0.23 to 8.0.26 and now MySQL service won't start anymore. I try brew services start mysql
and after few seconds the service status goes back to stopped. The last line in .err files in /usr/local/var/mysql
says
[ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
And when I delete the .err files they come back as owned by root. They were not owned by root before.
My current user is not root
and I do not use sudo
to run these commands. Why is this happening and how do I fix it?
Solution 1:
Fixed it myself by adding explicitly non-root user to ~/.my.cnf
[mysqld]
user=jva
Still don't know what caused it.