madvalue Posted September 16, 2017 Share Posted September 16, 2017 I have big problem with my mysql connection var mysql = require("mysql"); console.log("step 1"); var connection = mysql.createConnection({ host : "127.0.0.1", user : "root", password : "", database : "gtav" }); console.log("step 2"); connection.connect(function(e) { console.log("step 3"); if (e) { console.log("<b>DATABASE:</b> Wystąpił problem z połączeniem"); throw e; } else { console.log("<b>DATABASE:</b> Połączono z bazą danych"); } }); console.log("step 4"); connection.query("SELECT uuid FROM sq_accounts WHERE uuid=1", function (e, result) { console.log(result); console.log("step 4"); }); console.log("step 5"); Console print steps 1, 2, 4 and 5, soo connection.connect not work but i don't know why :v Link to comment Share on other sites More sharing options...
madvalue Posted September 16, 2017 Author Share Posted September 16, 2017 I change host from 127.0.0.1 to localhost and script start working, pls close or delete Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now