如何使用Data-Atom包设置适当的连接参数以在Atom编辑器中连接SQL Server数据库? [英] How to set the proper connection parameters to connect a SQL Server database in Atom Editor using Data-Atom package?
问题描述
我正在尝试在 Atom编辑器中使用 Data-Atom 包连接到SQL Server 2012数据库.我可以使用 Windows身份验证或 SQL Server身份验证,通过 SQL Server Managment Studio连接到数据库. data-atom-connections.cson
文件应如何使用这两种身份验证方法?
I'm trying to use Data-Atom package in the Atom Editor to connect to a SQL Server 2012 database. I can connect to the database with SQL Server Managment Studio using Windows Authentication or SQL Server Authentication. How the data-atom-connections.cson
file should be using these two authentication methods?
我的data-atom-connections.cson
文件如下所示:
[
{
name: "WindowsAuthentication"
protocol: "sqlserver"
user: "username"
password: "password"
server: "apphost/Username"
database: "master"
options: ""
}
{
name: "SQLServerAuthentication"
protocol: "sqlserver"
user: "userlogin"
password: "password"
server: "apphost/sqlexpress"
database: "master"
options: ""
}
]
但是我得到这个错误:
Error(ESOCKET) - Failed to connect to apphost:1433 - connect ECONNREFUSED 192.168.56.1:1433
Note: for specifying the server name I saw this post Logging In to SQL Server
推荐答案
此拉动请求被合并到数据原子中,您应该会有更多的运气.
When this pull request is merged into data-atom you should have more luck.
- 在服务器字段中输入
SERVER\INSTANCE
,如果直接编辑data-atom-connections.cson
,则输入SERVER\\INSTANCE
以连接到命名实例. - 将选项
domain=YOUR_DOMAIN
添加到选项字符串以使用Windows身份验证(请参阅 SQL Server的更多选项这里) - 如果您不想等待代码合并到上游和新版本中,请使用直接从我的仓库中下载,并将链接放置在
~/.atom/packages
下. - URL的协议部分已更改为
mssql
,以使SQL Server与node-mssql
保持一致.
- Enter
SERVER\INSTANCE
in the server field, orSERVER\\INSTANCE
if you're editingdata-atom-connections.cson
directly, to connect to a named instance. - Add the option
domain=YOUR_DOMAIN
to the options string to use Windows authentication (see more options for SQL Server here) - If you don't want to wait for the code to be merged into upstream and a new release, take it straight from my repo and place/link under
~/.atom/packages
. - The protocol part of the URL has changed to
mssql
for SQL Server to align withnode-mssql
.
这篇关于如何使用Data-Atom包设置适当的连接参数以在Atom编辑器中连接SQL Server数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!