Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make mysql dump file from terminal in mac

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
like image 764
Neeraj Sharma Avatar asked Jul 30 '16 16:07

Neeraj Sharma


People also ask

Where is Mysqldump on Mac?

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.


1 Answers

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
like image 50
HiDeo Avatar answered Oct 07 '22 03:10

HiDeo