如何使用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?

查看:208
本文介绍了如何使用Data-Atom包设置适当的连接参数以在Atom编辑器中连接SQL Server数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 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, or SERVER\\INSTANCE if you're editing data-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 with node-mssql.

这篇关于如何使用Data-Atom包设置适当的连接参数以在Atom编辑器中连接SQL Server数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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