问题遇到的现象和发生背景
应该是config配置的问题,不管是本地还是云端sql配置都是好的,用c#都是可以顺利连接,telnet也没问题,配置代码如下
问题相关代码,请勿粘贴截图
config:function(){
return{
type:"mssql",
user:'sa',
password:'xxxxxx',
server:"localhost",
database: "userinf",
port:1433,
option:{
encrypt:false,
},
pool: {
min: 0,
max: 10,
idleTimeoutMillis: 30000
}
}
}
运行结果及报错内容
连接时报错
ConnectionError: Failed to connect to localhost:1433 - self signed certificate,
在网上搜了下在option中加了trustServerCertificate: true也还是同样报错,
如果在localhost后加上实例名则显示
ConnectionError: Port for MSSQL15.MSSQLSERVER not found in localhost,但我已经配置了port,
而如果将localhost换成云服务器的ip则直接报错连接超时