Hanvod Posted June 11, 2018 Posted June 11, 2018 I am using the following code: var SQL = require('mysql') var c = SQL.createConnection({ host: '*here was my ip*', user: '*here was my user*', password: '*here was my password*', database: '*here was my database*' }); console.log("TESTTESTTEST"); c.connect(function(e) { console.log(123); if(e) { console.log("Error connecting to the database with error "+e); } else { console.log('Database connected!') } }); c.query("INSERT INTO Cars VALUES (5,5,5,5,123)") c.query("SELECT * FROM Cars", (err, result) => { console.log(result); }); and it doesnt work when I run it as a part of server package, but works well when I run it with Node. Please, help me.
Geramy92 Posted January 4, 2019 Posted January 4, 2019 I have a simelar issue (not with connection but with some transaction calls) ... did you found a solution (so that I maybe have a point where I have to look?)
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