I\'m using git bash on a windows 7 machine. When I try to use mysqldump I\'m getting an error: \"sh.exe\": mysqldump: command not found\". I am very new to this. Can somebod
You'll need mysqldump
on the path that bash is using to find commands. UN*X shells, like bash, and also windows cmd, use a PATH
environment variable to manage this.
To see your current path, type this in bash:
$ echo $PATH
If you've installed MySQL, it's typically located at c:\Program Files\MySql
, and the support programs, like mysqldump
, are in c:\Program Files\MySql\MySQL Server 5.5\bin\
. You'll need to have that directory on your path. If MySQL has been installed somewhere else on your machine then you'll need to find the bin
directory there and use that path in these instructions.
The best way to do this in windows is by changing the user or system environment variables. To do this, in Windows Explorer:
Computer
and select Properties
from the menu.Advanced System Settings
in the sidebar.Advanced
tab.Environment Variables
button.user
at the top, and system
below. Either will work, but let's change the system
settings.Path
in the Variable
column.Path
row.Variable value
field, scroll all the way to the end of the field, and at the end, add this: ;c:\Program Files\MySql\MySQL Server 5.5/bin/
. Note the leading semicolon: it won't work without it.OK
and now you can close all the dialogs/windows.Once you've done all that, close the Git bash window, and open another one. Type:
$ mysqldump
You should get Usage instructions from the program.
If not, look at the path again by typing:
$ echo $PATH
Do you see anything like what you added? Any MySQL directories there? It's likely you've just mistyped something, or missed the semicolon. Go over the steps again and make sure everything is correct.