I recently tried installing MySQL with homebrew (brew install mysql) and when I try to run it I get the following error:
ERROR 2002 (HY00
I had some directories left from another mysql(8.0) installation, that were not removed.
I solved this by doing the following:
First uninstall mysql
brew uninstall mysql@5.6
Delete the folders/files that were not removed
rm -rf /usr/local/var/mysql
rm /usr/local/etc/my.cnf
Reinstall mysql and link it
brew install mysql@5.6
brew link --force mysql@5.6
Enable and start the service
brew services start mysql@5.6