-2

So I am trying to connect my SQL database to an HTML file for my website. I have heard that you can use Node.js to do this, but I am not sure how to add node.js to my HTML and also connect it to my other JavaScript so I can record things from there.

1

1 Answer 1

0

you need to install nodejs first.refer this:https://nodejs.org/en/download/ then you need to install mysql using : npm install mysql then configure mysql using :

  const mysql = require('mysql');
  var pool = mysql.createPool({
    connectionLimit: 100,
    host           : "localhost",
    user           : "username",
    password       : "password",
    database       : "databasename"
});
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.