I have tried every possible way to solve this issue, like ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock, uninstall and reinstall mysql, make sure mysql is running on xampp but none of it still worked.
Finally, I open up my.cnf (config file) and copy the socket path (make sure to copy the full path else it won't work). Then I perform this command in my terminal
mysql --socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
Lo, and behold, mysql launchs.
This solution will only work if your MySQL is shown running on Xampp/Ampps, but in terminal it is still not connecting to the right socket when you have already attempted something like:
./mysql -u root
or
brew services start mysql
I hope this helps!
install mysql-serverpackage aswell, not justmysql- Hanky Pankymysql-servertoinstall. - jjpebrew services start mysqlor (if you don't want a background service)mysql.server start. - Dave Everitt5.7.19. The new [email protected] version5.7.24couldn't work because the some config reference was kept linked to the old mysql instead of the new brew Cellar [email protected] Keg. So thanks I try this later - KeitelDOGbrew upgradewhich will install a newer version of mysql than previously installed. - johnsampson