0

I'm quite new to node but believe I have the correct setup here.

I am working locally and have done... npm install mysql -g

When I go to type mysql -p in the node terminal it says that mysql is unrecognized. What am I doing wrong here?

1
  • npm install mysql -g won't necessarily install mysql on your machine, unless i'm mistaken. so commands are usually just executable applications that are found under a particular path, in Linux (& mac) it'll be an environment variable named $PATH and in windoze %PATH% - in whatever terminal you have, it probably doesn't include the mysql directory in the PATH environment variable - i recommend that you google how the PATH environment variable works at a minimum Commented Jan 27, 2016 at 2:23

1 Answer 1

2

The mysql module on npm does not provide any command-line tools, so installing it globally is of no use.

To use the mysql module, you will have to write your own script according to the module's documentation.

Sign up to request clarification or add additional context in comments.

1 Comment

Ah I see. I am just getting into the backend. I am able to use the plain mysql terminal but don't know how to integrate that with node. I know node-mysql is one such integration albeit without terminal support. Is there a module that allows mysql to be accessed from the node terminal or is node-mysql the best and I just have to write all the scripts. Just beginning I would like being able to use the terminal you know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.