使用SQL身份验证在本地连接到SQL Server [英] Connecting to a SQL Server locally using SQL authentication

查看:177
本文介绍了使用SQL身份验证在本地连接到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试连接到安装在PC上的本地SQL Server(使用SQL登录详细信息),由于某种原因,所有直观的方法似乎都失败了.我的连接字符串是这样的.

I''m trying to connect to a local SQL Server installed on my PC (using my SQL login details), and for some reason, all the intuitive methods seem to fail. My connection string is something like this.

Data Source=localhost/127.0.0.1;Initial Catalog=TESTA;User ID=userid;Password=pass


(实际上不是斜杠,我尝试了两个选项...)
缺少什么?


(The slash is not really there, I tried both the options...)
What is missing?

推荐答案

通常,您只需要输入地址127.0.0.1(local)

阅读此内容: http://www.connectionstrings.com/ [
Usually you just put the address 127.0.0.1 or (local)

Read this : http://www.connectionstrings.com/[^]


不知道-但我知道如何找到答案.

在Visual Studio中,打开服务器资源管理器"窗格.
如果您没有与数据库的连接,请通过右键单击数据连接"并选择添加连接..."来添加一个连接.遵循对话框,直到建立连接.
在服务器资源管理器"窗格中,单击数据库以突出显示它.
在属性"窗格中查找将在其中细化连接字符串"的地方-复制并粘贴它,它将起作用.
Don''t know - but I know how you can find out.

In visual studio, open the Server explorer pane.
If you do not have a connection to your database, add one by Right clicking "Data Connections" and selecting "Add Connection...". Follow the dialogs until you have a connection.
In the Server Explorer pane, click your database to highlight it.
Look in the Properties pane where you will fine "Connection String" - copy and paste this and it will work.


此外,在SQL Services配置中检查是否已为TCP/IP激活了TCP/IP.您尝试连接的实例.
Also, check in SQL Services configuration, that TCP/IP is activated for the instance you are trying to connect to.


这篇关于使用SQL身份验证在本地连接到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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