new Sequelize(
config.database,
config.username,
config.password,
config
);
с параметрами
require('dotenv').config();
const reconnectOptions = {
retry_on_reconnect: {
transactions: true
},
max_retries: 999,
onRetry: function(count) {
console.log("connection lost, trying to reconnect ("+count+")");
}
};
module.exports = {
database: process.env.DB_NAME,
host: process.env.DB_HOST,
port: process.env.DB_PORT,
dialect: process.env.DB_DIALECT,
logging: false,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
pool: {
max: 5,
min: 0,
idle: 10000
},
reconnect: reconnectOptions || true
};
и вылетает ошибка
SequelizeConnectionError: connect ETIMEDOUT
at Promise.tap.then.catch.err (/data/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:133:19)
at tryCatcher (/data/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/data/node_modules/bluebird/js/release/promise.js:517:31)
at Promise._settlePromise (/data/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/data/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/data/node_modules/bluebird/js/release/promise.js:695:18)
at _drainQueueStep (/data/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/data/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/data/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/data/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
что можно с ней сделать?
проверь свои креды на обычном клиенте mysql или postgresql (смотря что у тебя) скорей всего или креды не верные или хост не верный
Обсуждают сегодня