Is there a configuration option for using Unix domain socket to connect to SQL Server Instance?

白昼怎懂夜的黑 提交于 2021-02-10 12:38:25

问题


I am attempting to link an app engine service to an instance of SQL Server on the Google Cloud Platform using this documentation

My service is a nodejs application and I am using the mssql library to connect to my database.

The documentation only describes using TCP/IP (an ip address):

const pool = new sql.ConnectionPool({
    user: '...',
    password: '...',
    server: 'localhost',
    database: '...'
})

If I try to use localhost or 127.0.0.1 for my server, the connection fails:

I need help with one of the following:

  1. How can I connect to the SQL instance using TCP/IP using the mssql library?
  2. What is the configuration option for the connection pool using unix domain socket?

回答1:


I haven't actually done this one yet, so I'm guessing a little bit, but try one of these:

  1. Pass the unix socket to the server config tag.
  2. Pass localhost to the server tag and the unix socket value to the port tag.


来源:https://stackoverflow.com/questions/59383019/is-there-a-configuration-option-for-using-unix-domain-socket-to-connect-to-sql-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!