Friday, 9 June 2017

sails.js:mysql connection failed ReferenceError: localMysql is not defined

I am trying to connect mysql database to my sailsjs application

in config/connections.js

localMysql:{ //arbitrary name
        adapter: 'sails-mysql',
        host: '127.0.0.1',
        port: 3306,
        user: 'root',
        password: 'root'
    }

and in config/models.js

module.exports.models = {
    connection:localMysql

}

But i got the following error include-all attempted to require(/var/www/node/sails-test/config/models.js), but an error occurred:: Details:ReferenceError: localMysql is not defined



via Jabaa

No comments:

Post a Comment