MySQL from MAMP can’t run from terminal. You need to add mysql bin path in $PATH. From terminal you can do with export PATH like following
$ export PATH=/Applications/MAMP/Library/bin/:/opt/local/bin:/opt/local/sbin:$PATH
but it’s only for 1 time. You close the terminal and open again. It will lost. For permanently, you need to add in profile file.
How to
open terminal
$cd ~
$open -a TextEdit .profile
In TextEdit
# MacPorts Installer addition on 2009-10-28_at_16:24:44: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
Add new path in export PATH like this
# MacPorts Installer addition on 2009-10-28_at_16:24:44: adding an appropriate PATH variable for use with MacPorts.
export PATH=/Applications/MAMP/Library/bin/:/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
and then save it. Now, you can run mysql from terminal and also do mysqldump.