I have XAMPP setup on my Mac. Getting MySQL and PHP to run in terminal didn’t work after installation. To be able to run mysql and php you have to add the xampp application to the .bash_profile file in your users home directory.
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
# User specific environment and startup programs
To check that it has worked, open a new terminal session and type in:
Both should point to /Applications/xampp/xamppfiles