I upgraded from Mohave to Big Sur and found that homebrew is not working any more. I installed the command line tools using the command
xcode-select --install
After brew upgrade this did the trick to avoid tmp/mysql.sock error. Use commandline command:
sudo chmod -R 0777 /usr/local/var/mysql/