Cant login to SQL Server 2005

  • I have installed SQL server 2005 and I am trying to run on just my local machine. I have my own machine as my database engine and I am trying to use windows (Vista) login. I have copied the error message I get below: Can anyone help?

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

    Cannot connect to DAVIDS-PC.

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

    Login failed for user 'Davids-PC\David'. (.Net SqlClient Data Provider)

    ------------------------------

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476

    ------------------------------

    Server Name: DAVIDS-PC

    Error Number: 18456

    Severity: 14

    State: 1

    Line Number: 65536

    ------------------------------

    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.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

    at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)

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

  • What application are you using to connect? What are the steps you are taking to connect?

  • By default, users on Windows Vista that are members of the Windows Administrators group are not automatically granted permission to connect to SQL Server, and they are not automatically granted SQL Server administrator privileges.

    To let members of the Windows Vista Administrators group log in, you must explicitly add the account to the SQL Server logins. To add a server login, you need to log on to the server using "sa" login from SSMS or force SSMS to run under administator account (using Run as administrator).

    --Ramesh


  • Ramesh (2/18/2009)


    By default, users on Windows Vista that are members of the Windows Administrators group are not automatically granted permission to connect to SQL Server, and they are not automatically granted SQL Server administrator privileges.

    To let members of the Windows Vista Administrators group log in, you must explicitly add the account to the SQL Server logins. To add a server login, you need to log on to the server using "sa" login from SSMS or force SSMS to run under administator account (using Run as administrator).

    And that option is part of the install routine. You might need to go back and reinstall.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Ramesh

    Could you please explain further how I go about doing that, Im afraid Im quite new to sql server. Or if I need to re-install, what I will need to do differently.

    Thank you

  • Ramesh (2/18/2009)


    By default, users on Windows Vista that are members of the Windows Administrators group are not automatically granted permission to connect to SQL Server, and they are not automatically granted SQL Server administrator privileges.

    To let members of the Windows Vista Administrators group log in, you must explicitly add the account to the SQL Server logins. To add a server login, you need to log on to the server using "sa" login from SSMS or force SSMS to run under administator account (using Run as administrator).

    I wasn't aware of this in the Vista install of 2005 as I have only installed 2008 on Vista so I thought that was part of the 2008 install process and not related to Vista.

  • dave_282 (2/18/2009)


    Ramesh

    Could you please explain further how I go about doing that, Im afraid Im quite new to sql server. Or if I need to re-install, what I will need to do differently.

    Thank you

    If you have the "sa" login and it is enabled, then you can login to the server using SSMS and add the windows BUILTIN\Administrators Group to the sysadmin role or to any other role you wanted it to be.

    Or You can start SSMS under the administrator's context (i.e. using Run as administrator option) and do the above task.

    To add a login

    Click Security, right-click Logins, and then click New Login.

    In the Login name box, enter the user name.

    In the Select a page pane, click Server Roles, select the sysadmin check box, and then click OK.

    --Ramesh


  • Im afraid I dont know where to do all that, can you tell me where I need to go to do it.

    I dont seem to have users/groups in my computer management list and with vista, I seem to need to click a permission button every time I do something on my computer.

  • Using "sa" Login

    1. Click the Start button, point to All Programs, click Microsoft SQL Server 2005, and then click SQL Server Management Studio.

    2. Connect to an instance of SQL Server using SQL Authentication and login name as "sa"

    3. Click Security in Object Explorer, right-click Logins, and then click New Login.

    4. In the Login name box, enter the user name.

    5. In the Select a page pane, click Server Roles, select the sysadmin check box, and then click OK.

    Using Administrator login

    1. Click the Start button, point to All Programs, click Microsoft SQL Server 2005, right-click SQL Server Management Studio, and then click Run as administrator.

    2. In the User Access Control dialog box, click Continue.

    3. In SQL Server Management Studio, connect to an instance of SQL Server using Windows Authentication.

    4. Click Security in Object Explorer, right-click Logins, and then click New Login.

    5. In the Login name box, enter the user name.

    6. In the Select a page pane, click Server Roles, select the sysadmin check box, and then click OK.

    --Ramesh


  • Yes that worked, thank you very much for your help. I can now start using it :).

  • Ramesh (2/18/2009)


    Using "sa" Login

    Using Administrator login

    Or you can just run the SQLProv.exe tool that's provided with SP2 to set the desired administrative logins for you.

    Do a file search to find the exe, I can never remember which dir it is in.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Grant Fritchey (2/18/2009)


    Ramesh (2/18/2009)


    By default, users on Windows Vista that are members of the Windows Administrators group are not automatically granted permission to connect to SQL Server, and they are not automatically granted SQL Server administrator privileges.

    To let members of the Windows Vista Administrators group log in, you must explicitly add the account to the SQL Server logins. To add a server login, you need to log on to the server using "sa" login from SSMS or force SSMS to run under administator account (using Run as administrator).

    And that option is part of the install routine. You might need to go back and reinstall.

    SQL 2008 yes, SQL 2005 no. In 2005 it's an additional step that runs after installing SP2, but it's easy to miss.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (2/18/2009)


    SQL 2008 yes, SQL 2005 no. In 2005 it's an additional step that runs after installing SP2, but it's easy to miss.

    You seems to be experienced with SQL server, could you guys please help me with this issue:

    I spent one week on this problem and still stuck here. Could anyone spend a little time and help me, this would benefit other newbies like me as well. So many thanks in advance.

    The problem is dat I am using Microsoft SQL Server Management Studio Express, and when I connect to the server (localhost) with the default userid, password (sa account) it is working fine or with using the authentication mode of Windows Auth, it seems still nice to me.

    However, when I changed to use the other account (the database, login account and password will be configured as long as the Tomcat starts so the account and password should be correct), I got the following error:

    - Login failed for user 'XXX'. (Microsoft SQL Server, Error: 18456)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476

    With the state of 5 meaning the userid is incorrect.

    After that I change to the encryption mode, the following error appears:

    - A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate's CN name does not match the passed value.) (Microsoft SQL Server, Error: -2146762481)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-2146762481&LinkId=20476

    What you guys suspect is the problem? I create a self-certificate or other types of certificate, but in the Configuration Manager, I can't add the certificate in the drop-box list, in the error log it also mentioned that the can not register with the SPN for the SQL Service, I did add my computer even I am using localhost but it seems in vain as well....

  • Please post new questions in a new thread.

    Thanks.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Sorry but it's actually an old thread but there were no reponses so that I hope I will get some help here.

    Btw, I jz created a new thread alr...could you please give me a hand.

Viewing 15 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic. Login to reply