无法连接到(本地)数据库

我有SQL Server 2008,并被迫做一个新的Windows 7configuration文件。 我不能再连接到我的(本地)数据库。

一切我尝试使用Windows身份validationlogin我得到

无法连接到(本地)。

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

Server Name: (local) Error Number: 18456 Severity: 14 State: 1 Line Number: 65536 ------------------------------ Program Location: 

在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()

我没有安装SQL Server 2008.我的公司和我联系的支持人员无法提供帮助。

我做了一些进展,并能够使用基于韦恩的答案的 Windows身份validation“SQLEXPRESS”login。

我有2个服务

 SQL Server (MSSQLSERVER) - tried to log in but won't let me in SQL Server (SQLEXPRESS) - let me in 

我试图让(当地)仍然工作。 所以我不确定我是否可以使用这个新帐户来帮助我。

 =================================== Cannot connect to .\MSSQLSERVER. =================================== A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid) (.Net SqlClient Data Provider) ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=87&LinkId=20476 ------------------------------ Error Number: 87 Severity: 20 State: 0 ------------------------------ Program Location: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server) at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser() 

编辑

当在日志中检查我看到这一点

 2012-01-17 11:17:45.39 Logon Error: 18456, Severity: 14, State: 11. 2012-01-17 11:17:45.39 Logon Login failed for user 'MyAccount'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: <local machine>] 

您是否创build了新的个人资料或全新的帐户 ? 他们是非常不同的东西,差别是非常相对的。 如果您创build了全新的帐户,则需要授予该新帐户对默认实例的访问权限。

如果您刚刚创build了一个新的Windowsconfiguration文件,那么如果您尝试使用机器的主机名进行连接,它是否适用于您?

编辑:
基于你的更新,你正在使用错误的东西来连接。 您只想使用纯主机名连接到默认实例。 您不想使用完全限定的名称。 基本上没有名为MSSQLSERVER的实例。 这只是一个给予默认实例运行的服务的标签。

State 1表示您在此处发布的错误消息是通用login失败错误代码

find您的SQL Server错误日志并使用这篇文章来确定问题的真正原因。

摘自上面提到的有关login失败错误状态的文章:

 ERROR STATE ERROR DESCRIPTION 2 and 5 Invalid userid 6 Attempt to use a Windows login name with SQL Authentication 7 Login disabled and password mismatch 8 Password mismatch 9 Invalid password 11 and 12 Valid login but server access failure 13 SQL Server service paused 18 Change password required