This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I have a node js and MySQL server running locally, and cannot find out why I am unable to connect. I am able to get the DB server running using the credentials, but all I get is the error message that was coded in and I would like to know if there is somewhere I can go to find out why it is not connecting successfully. I'm thinking it's either a syntax error (Hoping this isn't it I've been looking the file up and down) or maybe a permissions issue but just want to know how I can look into this further.
const mysql = require('mysql');
var mysqlConnection = mysql.createConnection({
`host: 'localhost',`
`user:'admin',`
`password: 'root',`
`database: 'myca'`
});
mysqlConnection.connect((err)=>{
if(!err)
`console.log('DB connection actually worked :)');`
`else`
`console.log('This sucks :( try something else ');`
});
Subreddit
Post Details
- Posted
- 5 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/node/commen...