From a Terminal window type
or if you have already changed to that location type
From there it should just be a case of typing (assuming mysql is in the /xamppfiles/bin/ folder)
'/Applications/xampp/xamppfiles/bin/mysql -u root -p'
'./mysql -u root -p' if you have already changed to /Applications/xampp/xamppfiles/bin/