14
votes

I have installed Heroku toolbelt in my windows machine. But after executing heroku login I am getting the following error:

'MySQL' is not recognized as an internal or external command, operable program or batch file. 'MySQL' is not recognized as an internal or external command, operable program or batch file.

!    Git must be installed to use the Heroku Toolbelt.  
!    See instructions here: http://git-scm.com

I have already installed git, MySQL and all are working using cmd directly and my rails app is working correctly on my localhost. The strange thing is why heroku is even using mysql since I'm just loggin in. How can I resolve this issue?

7
Can you please elaborate on what software exactly you have installed and what configuration you have performed on your machine? You can't really "install" Github so I'm assuming you mean something else... - Christina
Since i was developing a rails application, the best way i heard to deploy it is on heroku. On documentation they say installing heroku Toolbelt which i installed & preconditions are installation of git & the bundle command should work using command prompt. Regarding github it was just a user interface application for windows which installs git automatically. - Rahul Gupta

7 Answers

14
votes

I was also getting the same error. I finally resolved it by changing the Path variable.

  • Escape the ampersand with a caret (^)

    C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.4^&MySQL Utilities 1.5.4 1.5\;

Note: Replace all occurrence of & by ^&. There could be 2 or more occurrence.

5
votes

This is failing due to a bug in Heroku launcher script as it doesn’t properly escape ampersands in the PATH environment variable.
You might have an & sign possibly in your MySQL path for MySQL Fabric & MySQL Utilities
source: https://discussion.heroku.com/t/heroku-installation-error/1149

1
votes

I changed the order i.e. Place the Heroku path in front of the path for MYSQL in the PATH environment variable.

It enabled my toolbelt to login. using the command heroku login. I still see the below message displayed, but login was successful: 'MySQL' is not recognized as an internal or external command, operable program or batch file.

1
votes

I finally reinstalled the mysql completely from my computer & now

heroku login

is working all fine! I think the issue is with installing heroku toolbelt before MySql. It's conflicting somehow.

Just install MySql after installing the toolbelt & It works for me.

1
votes

This worked for me as a fix Rename the path

C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\

to

C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 MySQL Utilities 1.5\

and then go to My Computer(right click)> Properties> Environment Variables Edit "path" Variable to contain

C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 MySQL Utilities 1.5\ 

instead of

C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\
0
votes

I guess you need to have the bin directory of your MySQL installation present in your PATH, so that "MySQL" becomes available as a command.

0
votes

The MySQL errors are caused by not having your MySQL installation on the System Path. Typically the default location for MySQL will be:

C:\Program Files\MySQL\MySQL Server X.X\bin

Where X.X is your MySQL version.

As an aside, under Windows, I personally find Rapid Environment Editor an invaluable tool for editing my environment variables (no affiliation). You can also do this without third-party helpers from Control Panel > System > Advanced > Environment Variables as described in the MySQL docs here (but after you've done this a few times you might see why I prefer Rapid Environment editor!).

As for the Git errors, I too had this problem On Windows 7 Pro, despite having Git and Tortoise Git installed. To resolve, first double-check that \git\cmd is in your System Path and is correct (in the same way as per the instructions for MySQL indicated above). If it is but the heroku command line continues to insist that it isn't, your heroku toolbelt install may have become corrupted on Windows. Try removing your heroku toolbelt's AppData\Local\heroku\ folder and then reinstalling heroku toolbelt. Typically, that means removing:

[C:\Users\YourUserName]\AppData\Local\heroku\

Doing so fixed my Heroku command line and removed the phantom Git errors it was reporting.

Finally after reinstalling heroku toolbelt, I recommend invoking heroku update from the command line to update it to the latest version.