zsh: command not found: mysqldump

Open the .zshrc file by running the following command:

nano ~/.zshrc

Do the following steps in that file:

  1. Paste the export PATH=”/usr/local/mysql/bin:$PATH” line in that end of that file.
  2. Hit CTRL + O
  3. Hit CTRL + Enter Key
  4. Hit CTRL + X

Above, /usr/local/mysql is base directory location of your mysql installation. You can find the base directory with the help of following resource: Find the MySQL installation directory location in MAC.

Close the terminal and restart it to test mysqldump command now.

Run the mysqldump command:

mysqldump

It should be working now and will give you the following output:

Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]