Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Sequelize = require('sequelize');
- const sequelize = new Sequelize('database', 'root', 'passwd', {
- host: 'localhost',
- dialect: 'mysql',
- // http://docs.sequelizejs.com/manual/tutorial/querying.html#operators
- operatorsAliases: false
- });
- sequelize
- .authenticate()
- .then(() => {
- console.log('Connection has been established successfully.');
- })
- .catch(err => {
- console.error('Unable to connect to the database:', err);
- });
Add Comment
Please, Sign In to add comment