Mysql is not recognized as an internal or external command

Hi,
An absolute newbie to RoR, I’m currently going through a few of the
excellent tutorials that are available on the subject.

One of these includes running a script for creating a mySQL table. In
the command prompt (XP), I try

mysql depot_development <db/create.sql

but get the following error:

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

Any ideas as to what goes wrong?

Br and thx in advance,
/Bo

Hi!

Do you have the MySQL database properly installed? It does not come with
RoR, and you have to install it separately. http://mysql.com

Allen

PS - There may also be a package to install that includes RorR, MySQL
and perhaps other related software.

Allen F. wrote:

Hi!

Do you have the MySQL database properly installed? It does not come with
RoR, and you have to install it separately. http://mysql.com

Allen

PS - There may also be a package to install that includes RorR, MySQL
and perhaps other related software.

He is using Windows, which means it could very well be installed. One
doesn’t typically use the command-line interface on Windows, though, but
rather some sort of GUI front-end. I wouldn’t be surprised if MySQL is
installed but not in the PATH environment variable.

Someone with more experience using MySQL on Windows can make a
recommendation.


Jesse F. [email protected]
University of Chicago - NSIT Web Services
AIM: farmerje
Jabber: [email protected]
Phone: (773)363-1058

Bill W. wrote:

Jesse F. wrote:

I wouldn’t be surprised if MySQL is
installed but not in the PATH environment variable.

Good guess, at least as a starting point.

Bo Vittrup wrote:

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

Any ideas as to what goes wrong?

Per Jesse’s comment above, the error above is the one Windows throws in
either of two cases:

  1. the software is not installed
  2. the software is installed but Windows can’t find the executable

I assume you’ve used Windows Explorer to verify that the mySQL software
exists on your computer. If not, please do.

You can check the PATH from the command line. Just enter PATH. If the
mySQL directory isn’t listed in what’s printed in response, and you used
the
Windows Installer to install the softtware, you probably need to
reinstall
it. The installer should have modified the PATH and, if it didn’t,
there
may be other stuff it had trouble with too. If you want to add the
mySQL
directory to the PATH yourself you can do it through Start -> Settings
->
Control Panel -> System -> Advanced tab -> Environment Variables button.

Best regards,
Bill

Hi again,

Thank you very much for the quick answers to my post. I realize that I
did not put mysql in PATH - it is now and now at least something happens
if I open a prompt and type ‘mysql’.

However, when trying to run mysql from ruby I now get the error:

Error 1045: Access denied for user ‘ODBC’@localhost’ (using password:
NO)

Did I set up some privileges incorrect or?

Br Bo

Hi Bo,
You need to make sure the MySQL Server is running.

If you installed the 4.1 version, you should see a MySQL program group
in
your Start menu.

Start > Programs > MySQL > MySQL Server 4.1 > MySQL Server Instance
Configuration Wizard. Use the Wizard to set up MySQL as a service that
starts when you start up your computer.

There is additional info in the my.ini file in C:\Program
Files\MySQL\MySQL Server 4.1

Take care,
Dave

“Bo Vittrup” [email protected] wrote in message
news:[email protected]

Jesse F. wrote:

I wouldn’t be surprised if MySQL is
installed but not in the PATH environment variable.

Good guess, at least as a starting point.

Bo Vittrup wrote:

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

Any ideas as to what goes wrong?

Per Jesse’s comment above, the error above is the one Windows throws in
either of two cases:

  1. the software is not installed
  2. the software is installed but Windows can’t find the executable

I assume you’ve used Windows Explorer to verify that the mySQL software
exists on your computer. If not, please do.

You can check the PATH from the command line. Just enter PATH. If the
mySQL directory isn’t listed in what’s printed in response, and you used
the
Windows Installer to install the softtware, you probably need to
reinstall
it. The installer should have modified the PATH and, if it didn’t,
there
may be other stuff it had trouble with too. If you want to add the
mySQL
directory to the PATH yourself you can do it through Start -> Settings
->
Control Panel -> System -> Advanced tab -> Environment Variables button.

Best regards,
Bill