I recently started using Cmder, and I am now getting this message; even though MySQL is on my %Path, what gives?
Same here - do you have any solution?
I recently installed MySQL and am also getting this, and since doing so Cmder no longer recognizes ruby, rails or bundler as commands. My normal command prompt still does.
I just installed MySQL as well and had the same problem. Through some experimenting and research I found out that it had to do with my PATH having an &.
In my case it was the path
C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.4 & MySQL Utilities 1.5.4 1.5\
which appears new to me.
Short explanation is that the cmder/vendor/init.bat file tries to put the path with the & into the PATH variable of the DOS script. However it somehow reads the content after the & as a new line. This results in cmder attempting to execute a MySQL program with the rest of the string as parameters.
@prochafilho you said you have MySQL in your path, this makes me think that the path to MySQL Server 5.6\bin is after the &.
The solution to this is simply wrapping the path which contains the & with double quotes in the environment variables.
"C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.4 & MySQL Utilities 1.5.4 1.5\"
I found a stackexchange question which suffered from this same phenomenon and have elaborated in more detail over there.
Huzzah! You're a genius
An '&' is used to execute multiple commands. This:
set foo = this & that
is interpreted as two commands:
set foo = this
that
You can get the right behavior like this, which might not be intuitive:
set "foo = this & that"
You are literally a life saver! I think this issue should be addressed on the docs, maybe?! Thank you so much!
path and Mysql variables are set as suggested but still no luck. It keeps saying "'MySQL' is not recognized as an internal or external command".
This is related to: https://github.com/cmderdev/cmder/issues/185
For anyone still having this problem: this simple fix did the trick for me:
(just put double quotes around the whole thing in cmder/vendor/init.bat)
:: Enhance Path
@set "PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%"
@kfrederix you saved me head banging on command prompt, please accept a cookie !
Just to put a pin in this, probably the best way to do it (as the /vendor/init/bat file will be changed per update) is to add the caret ('^') escape character in the actual path, just before the '&'.
Thank you @kfrederix . Solved my issue.
@quocanha Thanks a lot!!!
Most helpful comment
This is related to: https://github.com/cmderdev/cmder/issues/185
For anyone still having this problem: this simple fix did the trick for me:
(just put double quotes around the whole thing in
cmder/vendor/init.bat)