If you have installed XAMPP on your Mac and have started the service of MySQL, but when you try to connect to the database service via the Terminal, you get "zsh command not found MySQL", well the reason is you have not set the PATH variable.
Steps for the fix:
- Make sure that the MySQL and Apache service is running and that you can able to access the PHPMyAdmin via a web browser on localhost.
- Now go to the Terminal app and move to /Applications folder.
- Next, move to the XAMPP folder and then the bin folder.
- You should be able to see the MySQL binary file here, just do a PWD and copy the path.
% pwd /Applications/XAMPP/bin - Now add this path to the PATH environment variable:
export PATH="/Applications/XAMPP/bin:$PATH" - Try to connect to MySQL via console now and it should work.
% mysql -u root -p

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!