sequelize连接mssql报错
const db = require(‘sequelize’)
const connetdb = new db(‘cgclcc’, ‘sa’, ‘123’, {
host: ‘127.0.0.1’,
dialect:’mssql’,
});
async function q1(){
try {
await connetdb.authenticate();
console.log(‘Connection has been established successfully.’);
} catch (error) {
console.error( error);
}
}
q1()
报错信息如下:
You get the same error if you use options.encrypt: true on Node v12+ with old SQL Server versions. This is caused by Node v12 requiring TLS 1.2. There is nothing tedious could do about it, so you got 3 options: