问题
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:
- How can I connect to the SQL instance using TCP/IP using the
mssql
library? - 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:
- Pass the unix socket to the
server
config tag. - Pass
localhost
to theserver
tag and the unix socket value to theport
tag.
来源:https://stackoverflow.com/questions/59383019/is-there-a-configuration-option-for-using-unix-domain-socket-to-connect-to-sql-s