This one is for all MySQL-DBA's, which are working on macOS.
Since the Apple OS has a rather peculiar way of starting and
stopping MySQL, compared to Linux, you can run into some issues.
These problems occur especially, if you have no access to the
GUI.
Preparation
Put skip-grant-tables into the mysqld
section of the my.cnf. A my.cnf can be
found in /usr/local/mysql/support-files. You MUST
work as root for all the following steps.
shell> sudo -s
shell> vi /usr/local/mysql/support-files/my-default.cnf
...
[mysqld]
skip-grant-tables
skip-networking
...
Save the configuration file! (In vi this is "[ESC] + :x")
Continue with stopping MySQL:
launchctl unload /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
Restart MySQL, so skip-grant-tables becomes active:
launchctl load …
[Read more]