Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to node.js, I define a string and want to know how to use it, if i want to use trusted connection without any password or username like in C#

var configSQL = "Server=(local);Database=Loginfm_data;Trusted_Connection=True;";

I used the above connection string but it is giving me error "Error Connection ENCOUNTERED"
C#
var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'FASTIAN-PC',
  password : 'fastian123',
});

connection.connect();


here is the code and error
http://img209.imageshack.us/img209/4922/ll0w.jpg[^]
Posted

1 solution

Make sure networking is enabled on your mysql server config, see here : http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html[^]

[EDIT]
Read this also : http://stackoverflow.com/questions/5818312/mysql-with-node-js[^]
 
Share this answer
 
v2
Comments
saad_lah 16-Sep-13 10:52am    
thanx for the response, but networking is enabled and I can access the database through visual studio (localhost) from my ASP.NET Web application...
but I am a noob with node.js :(
Mehdi Gholam 16-Sep-13 12:22pm    
Is node on the same machine?
saad_lah 16-Sep-13 12:28pm    
yes, of course!
Mehdi Gholam 16-Sep-13 13:00pm    
See the edited answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900