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-server
package aswell, not justmysql
– Hanky Panky Mar 16 '13 at 13:57mysql-server
toinstall
. – jjpe Apr 5 '16 at 9:49brew services start mysql
or (if you don't want a background service)mysql.server start
. – Dave Everitt Jun 14 '17 at 15:315.7.19
. The new mysql@5.7 version5.7.24
couldn't work because the some config reference was kept linked to the old mysql instead of the new brew Cellar mysql@5.7 Keg. So thanks I try this later – KeitelDOG Dec 28 '18 at 21:12brew upgrade
which will install a newer version of mysql than previously installed. – johnsampson May 23 '19 at 17:47