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 trialChristopher Sumpter
18,007 Points'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.
Christopher Sumpter
18,007 PointsYes, I have MySQL Server 5.6 installed.
3 Answers
Tommy Bregar
10,847 PointsThis 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:
- Go to Control Panel -> System -> Advanced
- Click Environment Variables
- Under System Variables find PATH and click on it.
- 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.
- Go back to Desktop
- Close any command prompts you may have open Got to do this so the new $PATH variable will load.
- 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!
Christopher Sumpter
18,007 PointsYes, I still had to monkey around with it a bit to enter my password, but it finally loaded. Thank you!
Tommy Bregar
10,847 PointsGlad to help :)
Dat Tran
723 PointsWell done, it works. Really appreciate your help!
Iain Simmons
Treehouse Moderator 32,305 PointsI 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
Colin Xu
4,967 PointsThanks a bunch, that did the trick for me!
Graeme Campbell
15,594 PointsBrilliant, Thank you Iain, that solved my problem :D.
William Li
Courses Plus Student 26,868 PointsWilliam Li
Courses Plus Student 26,868 Pointsdo you have mysql installed?