The problem is on line 191 of mysql.server:
- Code: Select all
su - $user -s /bin/sh -c "kill $*" >/dev/null 2>&1
It can be fixed like this:
- Code: Select all
sudo -u $user kill $* > /dev/null 2>&1
I believe this affected older versions of macOS too, because I have had to use Activity Monitor to kill mysql for as long as I can remember. If anyone can explain why the su command fails, I am curious to learn. I guess there is some restriction where it only allows "real users". For example, user maggie shows exit status 0, while the _mysql user shows exit status 1.
- Code: Select all
sh-3.2# su - maggie -c "date"; echo $?
Sun May 19 16:30:04 PDT 2019
0
sh-3.2# su - mysql -c "date"; echo $?
1