SQL Server不会让我login

我已经在Windows 7机器上安装了SQL Server 2005(开发版)(我知道 – 这不是我的select!)机器被命名为用户PC,并且只有一个用户:user no pwd。

我正尝试使用Windows身份validation使用服务器USER-PC(从选项列表中取得)连接到DATABASE ENGINE。

我得到消息Logon failed for user-PC\user (Microsoft SQL server error 18456)

这是跟踪:

无法连接到USER-PC。

 ===================================

用户“用户PC \用户”login失败。  (.Net SqlClient数据提供程序)

 ------------------------------
要获得帮助,请单击:http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476

 ------------------------------
服务器名称:USER-PC
错误号码:18456
严重性:14
状态:1
行号:65536


 ------------------------------
计划地点:

   在System.Data.SqlClient.SqlInternalConnection.OnError(SqlExceptionexception,布尔breakConnection)
   在System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)
   在System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(布尔enlistOK)
   在System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo,String newPassword,Boolean ignoreSniOpenTimeout,Int64 timerExpire,SqlConnection owningObject)
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host,String newPassword,Boolean redirectedUserInstance,SqlConnection owningObject,SqlConnectionString connectionOptions,Int64 timerStart)
   在System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection拥有对象,SqlConnectionString连接选项,stringnewPassword,布尔redirectedUserInstance)
   在System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity身份,SqlConnectionString连接选项,对象providerInfo,stringnewPassword,SqlConnection owningObject,布尔redirectedUserInstance)
   在System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions选项,对象poolGroupProviderInfo,DbConnectionPool池,DbConnection拥有连接)
   在System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection,DbConnectionPoolGroup poolGroup)
   在System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection拥有连接)
   在System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory)
   在System.Data.SqlClient.SqlConnection.Open()
   在Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci,IServerType服务器)
   在Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

我考虑得越多,我认为这个评论就越是回答 – 尝试并以pipe理员身份运行(右键单击,select以pipe理员身份运行),然后查看是否有效。 我的猜测是,该帐户可能没有作为pipe理员或pipe理员组的特权。 一旦进入SQL,您可以将该帐户作为login名添加到SQL Server,并授予其系统pipe理员权限(假定您希望拥有该权限)。

想到很多问题:

  1. 你是本地连接还是远程连接?

  2. 这是默认实例还是命名实例?

  3. 什么protocoles启用,你使用什么连接方法? TCP / IP,命名pipe道,共享内存?

使用SQL Server 2005(所有版本)默认情况下:

  • 没有networking访问(使用本地SQL Serverconfiguration工具可以改变这一点:不要忘记添加防火墙exception)。

  • 只有本地pipe理员组可以访问(您可以使用SQL Server Management Studio或SQL语句添加具有适当权限的映射到其他Windows用户的login名/用户)。

(SQL Server 2008在安装程序中提示用户/组以获取初始服务器pipe理员访问权限。)