是否有使用Unix域套接字连接到SQL Server实例的配置选项? [英] Is there a configuration option for using Unix domain socket to connect to SQL Server Instance?

查看:49
本文介绍了是否有使用Unix域套接字连接到SQL Server实例的配置选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用

我需要以下其中一项的帮助:

  1. 如何使用 mssql 库使用TCP/IP连接到SQL实例?
  2. 使用unix域套接字的连接池的配置选项是什么?

解决方案

我实际上还没有做过,所以我有点猜测,但是请尝试以下一种方法:

  1. 将unix套接字传递到 server config标签.
  2. localhost 传递给 server 标记,并将unix套接字值传递给 port 标记.

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?

解决方案

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.

这篇关于是否有使用Unix域套接字连接到SQL Server实例的配置选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆