sequelize-typescript icon indicating copy to clipboard operation
sequelize-typescript copied to clipboard

Failed to connect to *name_server* - getaddrinfo ENOTFOUND

Open eugenestepaniuk opened this issue 4 years ago • 1 comments

Issue

Versions

  • sequelize: 6.3.5
  • sequelize-typescript: 2.1.0
  • typescript: 3.9.9

Issue type

  • [x] bug report
  • [ ] feature request

Actual behavior

an error occurs when connecting the server to the database Failed to connect to ANJUTA2 \ SQL2016: 1433 - getaddrinfo ENOTFOUND ANJUTA2 \ SQL2016

how to make a connection only by name (ANJUTA2 \ SQL2016), why does it tighten the port if I do not specify it?

Expected behavior

connection only by name (ANJUTA2 \ SQL2016)

Related code

tsconfig

"compilerOptions": {
      "target": "es6",
      "module": "commonjs",
      "lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
      "sourceMap": true,
      "outDir": "./dist",
      "rootDir": "./source",
      "moduleResolution": "node",
      "removeComments": true,
      "noImplicitAny": true,
      "strictNullChecks": true,
      "strictFunctionTypes": true,
      "noImplicitThis": true,
      "noUnusedLocals": true,
      "noUnusedParameters": true,
      "noImplicitReturns": true,
      "noFallthroughCasesInSwitch": true,
      "allowSyntheticDefaultImports": true,
      "esModuleInterop": true,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "resolveJsonModule": true
    },
    "exclude": ["node_modules"],
    "include": ["./source/**/*.tsx", "./source/**/*.ts"]
  }

Sequelize connection

import { Sequelize } from 'sequelize-typescript'
import { environment } from '../config'
import { normalize, join } from 'path'

export default new Sequelize({
  database: environment.database.database,
  dialect: "mssql",
  username: environment.database.username,
  password: environment.database.password,
  host: environment.database.host,
  logging: !environment.production ? console.log : false,
  models: [normalize(join(__dirname, "..", "models"))],
  dialectOptions: {
    options: {
      enableArithAbort: true,
      cryptoCredentialsDetails: {
        minVersion: "TLSv1",
      },
    },
  },
})

eugenestepaniuk avatar Apr 30 '21 06:04 eugenestepaniuk

Good afternoon Did you manage to fix the error ? How did you connect to mssql I have a similar error, I can't connect to the server Although there is definitely access

SlavaDen avatar Jul 28 '21 21:07 SlavaDen