Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby ActiveRecord Basics Migrations and Relationships Migrations

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

I am using Start Command Prompt with Ruby on Windows 8.1. When I type mysql -uroot, I get the message 'mysql' is not recognized as an internal or external command, operable program or batch file.

Yes, I have MySQL Server 5.6 installed.

3 Answers

This line is possibly due to a permissions issue:

5616 [ERROR] InnoDB: The system tablespace must be writable!

Try starting your command prompt as Administrator (Start-> Run-> cmd RIGHT CLICK-> Run as Administrator...)

As for this line:

c:\Users\sumpt_000\biller>mysql -uroot 'mysql' is not recognized as an internal or external command, operable program or batch file.

Be sure that your mysql\bin folder is part of your $PATH variable:

  1. Go to Control Panel -> System -> Advanced
  2. Click Environment Variables
  3. Under System Variables find PATH and click on it.
  4. In the Edit windows, find the end of the string of paths (each path needs to be separated by a semi-colon ";" so you may need to add that to the end) add the path to your mysql\bin folder to the end paths.
  5. Go back to Desktop
  6. Close any command prompts you may have open Got to do this so the new $PATH variable will load.
  7. Re-open command prompt. Try running mysql -uroot and if the path was set correctly, mysql will now run.

Let us know if this takes care of it!

Yes, I still had to monkey around with it a bit to enter my password, but it finally loaded. Thank you!

Glad to help :)

Well done, it works. Really appreciate your help!

I realise this question has been answered, but something else I just discovered with my own Windows installation of MySQL is that some of the folders that are created and added to the PATH variable upon installing MySQL contain an ampersand (&) character, which breaks when passed as a parameter.

You might find that the C:\Program Files\MySQL\MySQL Server 5.0\bin directory comes after the one with the ampersand in the PATH variable.

The solution in this case is to escape the ampersand with a caret (^), so it is ^&

e.g.

C:\Program Files\MySQL\MySQL Fabric 1.5.4 ^& MySQL Utilities 1.5.4 1.5\;C:\Program Files\MySQL\MySQL Fabric 1.5.4 ^& MySQL Utilities 1.5.4 1.5\Doctrine extensions for PHP\;C:\Program Files\MySQL\MySQL Server 5.6\bin

Thanks a bunch, that did the trick for me!

Brilliant, Thank you Iain, that solved my problem :D.