0

Can I use MYSQL like MongoDB with node.js for increasing the website speed.

Since Almost every popular programming language like Java or PHP provides driver to access and perform operations with MySQL.

3
  • Yes. many people uses mysql. It is not compulsory that you must use MongoDB. If your data is relational, you can use it. Commented Dec 8, 2015 at 4:52
  • can you share me the code example it will highly appreciable Commented Dec 8, 2015 at 5:01
  • Check this ; codeforgeek.com/2015/01/nodejs-mysql-tutorial Commented Dec 8, 2015 at 5:03

1 Answer 1

4

node-mysql is probably one of the best modules out there used for working with MySQL database which is actively maintained and well documented.

To install the MySQL node.js driver:

If you run just npm install mysql, you need to be in the same directory that your run your server. I would advise to do it as in one of the following examples:

For global installation:

npm install -g mysql

For local installation:

1- Add it to your package.json in the dependencies:

    "dependencies": {
        "mysql": "~2.3.2"
    }

2- run npm install

in my personal openion, mysql is slower than postgres and mongo db

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

Comments

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.