Used brew's remove & cleanup commands, unloaded the launchctl script, then deleted the mysql directory in /usr/local/var
, deleted my existing /etc/my.cnf
(leave that one up to you, should it apply) and launchctl plist
Updated the string for the plist. Note also your alternate security script directory will be based on which version of MySQL you are installing.
Step-by-step:
brew remove mysql
brew cleanup
launchctl unload -w /usr/local/Cellar/mysql/8.0.16/homebrew.mxcl.mysql.plist
rm /usr/local/Cellar/mysql/8.0.16/homebrew.mxcl.mysql.plist
sudo rm -rf /usr/local/var/mysql
I then started from scratch:
installed mysql with brew install mysql ran the commands brew suggested: (see note: below)
./usr/local/Cellar/mysql/8.0.16/bin/mysql_secure_installation
Start mysql with mysql.server start command, to be able to log on it
Used the alternate security script:
Followed the launchctl section from the brew package script output such as,
#start
launchctl load -w /usr/local/Cellar/mysql/8.0.16/homebrew.mxcl.mysql.plist
#stop
launchctl unload -w /usr/local/Cellar/mysql/8.0.16/homebrew.mxcl.mysql.plist
Add the following to my.cnf:
pid-file = /usr/local/var/run/mysqld/mysqld.pid
Create the directory/file:
mkdir /usr/local/var/run/mysqld
touch /usr/local/var/run/mysqld/mysqld.pid
chown -R mysql:mysql /usr/local/var/run/mysqld
To find my.cnf, you may run mysql --help | grep cnf
to find possible options.
Alternatively you can configure the connection in MySQL Workbench by accessing Database > Manage connections > [Select connection on left side] > System Profile > Configuration File.