Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JDBC and Relational Databases and the fly likes Setting up MySQL on Windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Setting up MySQL on Windows" Watch "Setting up MySQL on Windows" New topic

Setting up MySQL on Windows

Eric Kantola

Joined: Nov 21, 2011
Posts: 5
I'm trying to teach myself Java Servlets and JSP pages. I'm using Murach's Java Servlets and JSP, 2nd edition book.
I'm supposed to download MySQL from the website then install it, which I've done. The book recommends I install MySQL at C:\Program Files\MySQL\MySQL Server 5.0. It further recommends installing the book files, including the database files at C:\murach\servlet_jsp\db. I've done that.
When I double-click on the setup_db.bat file to run it, I get the following error message," The system cannot find the path specified. 'mysql' is not recognized as an internal or external command, operable program or batch file."
Please note that Tomcat and Netbeans are setup and configured adequately, so I don't think it has any interoperation problems.
Knowing that Windows gets a little picky about spaces in it's classpath, I changed "MySQL Server 5.1" to "MySQL_Server5.1". I still get the same error message.
What am I doing wrong?
Thank you in advance for your helpful replies.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

THis doesn't seem to have anything at all to do with Servlets and JSP, so I've modified the subject a bit and moved it to the JDBC forum.

[Asking smart questions] [About Bear] [Books by Bear]
dineshiop kumar

Joined: Mar 05, 2009
Posts: 13
when you install mysql irrespective to the location you should add the jar file to the netbeans and connected it make sure the properties are correctly set
Paul Clapham

Joined: Oct 14, 2005
Posts: 19869

I'm guessing that installing MySQL didn't change your PATH environment variable to include the bin folder of your MySQL install (or wherever mysql.exe ended up). If it didn't, then you're going to have to do that yourself.

(The PATH environment variable contains a list of Windows folders where Windows looks when you ask it to run some executable from the command line.)
I agree. Here's the link:
subject: Setting up MySQL on Windows
It's not a secret anymore!