how to import and export mysql dump file in mac
like in windows, I use this code:
mysqldump -u root -p --databases DBname>d:\ FILENAME.sql
but it does not work in mac terminal. it produce error:
-bash: mysqldump: command not found
If you are using MAMP and you are getting a “mysqldump command not found” message using the Terminal this is what you have to do: Locate the “mysqldump file inside MAMP. It is usually located in /Applications/MAMP/Library/bin/mysqldump.
The location where mysqldump
is installed need to be declared in your $PATH
.
If you don't know how to edit your $PATH
on macOS, you can refer to this question.
For example, if your mysqldump
binary is located in /usr/local/mysql/bin
, you can edit your $PATH
to:
export PATH=$PATH:/usr/local/mysql/bin
With this modification, you won't have to provide the full path to the mysqldump
binary every time and will be able to use your command:
$ mysqldump -u root -p --databases DBname>d:\ FILENAME.sql
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With