0

I am Using Nodejs with MySQL.

But problem is that My MYSQL Connection Password Able to see in browser, With this any user get my my SQL username and Password.

Is it possible no one can see my MySQL Connection permanent as its is a server side.

Can any one help me in this.

1
  • 1
    Add in some code.. or the URL to the web page that you are developing.. Commented Oct 5, 2013 at 8:41

2 Answers 2

1

Do not send you password to client but store it in a variable inside your server-side script. On a request, use it to access database and send only the result of the operation.

If you show your code you might get a more detailed answer then this...

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

Comments

0
 var connection = mysql.createConnection({
   host     : 'host',
   user     : 'dbuser',
   password : "pword",
   database : 'database',
 });

 connection.connect();

 connection.query(etc etc etc)

for full example see mysql module in node.js not works in my case

or another way is to save the configuration and password details in either an env file or other file (or even sqlite db file and load it on startup/restart of your script

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.