connection .authenticate() .then(() => { console.info('INFO - Database connected.') }) .catch(err => { console.error('ERROR - Unable to connect to the database:', err) })
/** * Tests the connection to the DB, returning true if the connection succeeds. If the connection * fails, an error is thrown. */ function testConnection() { return db.authenticate() .then(() => true); }
var callbackDatabaseCreation = function() { sequelizeMaster.close(); sequelize.authenticate() .then(function(err) { scriptExecuter(scriptTablesCreation, callbackCreation, sequelize) }); }
sequelize .authenticate() .then(function(err) { console.log('Connection has been established successfully.'); }, function (err) { console.log('Unable to connect to the database:', err); });
sequelizeConnection.authenticate().then(() => { console.log('Connection has been established successfully!'); }).catch((err) => { console.log('Can\'t establish database connection:\n' + err); });
// Try DB connection sequelize .authenticate() .then(() => { logger.info('MySQL connection has been established successfully.') }) .catch(err => { logger.error('Unable to connect to the database:', err) process.exit(2) })
db .authenticate() .then(() => { console.log('Connection has been established successfully.') }) .catch(err => { console.error('Unable to connect to the database:', err) })
connection .authenticate() .then(() => { console.info('INFO - Database connected.') }) .catch(err => { console.error('ERROR - Unable to connect to the database:', err) })
connection .authenticate() .then(() => { console.info('INFO - Database connected.') }) .catch(err => { console.error('ERROR - Unable to connect to the database:', err) })
// establish mysql connection sequelize .authenticate() .then(() => { logger.info('Sequelize has established mysql connection successfully.'); }) .catch(err => { logger.error('Sequelize was unable to connect to the database:', err); });
// Verify connection successfull sequelize .authenticate() .then(function(err) { console.log('DB connection has been established successfully.'); }, function (err) { console.log('Unable to connect to the database:', err); });
sequelize .authenticate() .then(() => { logger.info('Successfully established connection to database') }) .catch((err) => { logger.error('Unable to connect to database', err) })
//测试数据库链接 sequelize.authenticate().then(function () { console.log("数据库连接成功"); }).catch(function (err) { //数据库连接失败时打印输出 console.error(err); throw err; });
var callbackDatabaseCreationBig = function() { sequelizeMaster.close(); sequelizeDWH.authenticate() .then(function(err) { scriptExecuter(scriptTablesCreationBig, callbackCreationBig, sequelizeDWH) }); }
sequelize.authenticate() .then(() => { console.log("Conectado") }) .catch(err => { console.log("No conectado") })