Fix: zsh: command not found: mysql (Mac XAMPP)

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
    • 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
fix - zsh command not found mySQL

Have Questions? Post them here!