Wednesday, 12 April 2017

Npm Mysql Connection Error

I'm Working on Database connection part with Npm and installed package mysql. When I try to connect with Mysql script, I'm getting below error :

Cannot resolve module 'net'
Cannot resolve module 'tls'
Cannot resolve module 'fs'

Mysql Connection Code :

var mysql = require('mysql');
var connection = msyql.createConnection({
    host: 'localhost',
    user: 'xxxx',
    password: 'xxxx',
    database: 'xxxx',
    port: 'xxxx'
});

connection.connect();

I've googled and implemented all the possible methods suggested in forums. But the error is not resolving. Please do let me know how can I come out of it..



via Bhushan D

No comments:

Post a Comment