php – Permission denied when trying to make mysqldump from the local database

I want to make a backup of my local MySQL database using the MAC terminal but when I enter:

/ usr / local / mysql / bin / mysqldump -uroot -p localdev> localdev.sql

I get the error permission denied

I tried adding a password to my local phpmyadmin so the password for the root user is 123456 but when I entered:

/ usr / local / mysql / bin / mysqldump -uroot -p123456 localdev> localdev.sql

I get the same mistake!?!

I am using MAMP, so can it be a reason why it fails?

Please help