skip to Main Content

I want to backup my local MySQL database by 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 to add a password to my local phpmyadmin so that 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 error!?!

I’m using MAMP, so can that be a reason it fails?

Please help

2

Answers


  1. Chosen as BEST ANSWER

    Allright, I found out tHAT I needed to change the path to:

    /Applications/MAMP/Library/bin/mysqldump -u root -p123456 localdev > localdev.sql
    

    This solved it :-)

    Thanks for all your help anyway!


  2. You need a space between -u and username, like this:

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

    Space between -p and password DONT need

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search