不能登录到SQL Server 2008,在Windows 7 x64。

时间:2022-11-19 13:17:40

Alright wasted hours and hours trying to get MSSQL Server 2008 to login via SQL Server Management Studio. It works fine in Windows XP computer, but in Windows 7 it does not work.

好的,为了让MSSQL Server 2008通过SQL Server Management Studio登录而浪费的时间和时间。它在Windows XP上运行良好,但在Windows 7上就不工作了。

Steps done:

步骤完成:

  1. Install MSSQL, add logged-in administrator user in installation.
  2. 安装MSSQL,在安装中添加登录的管理员用户。
  3. type the correct hostname in the "login window" of SQL Server Management Studio.
  4. 在SQL Server Management Studio的“login”窗口中键入正确的主机名。
  5. Error 18456 is returned with Windows authentication.
  6. 使用Windows身份验证返回错误18456。
  7. SQL authentication, with username and password matching my windows account, does not work.
  8. SQL身份验证,用户名和密码匹配我的windows帐户,不工作。
  9. Created a new user called it 'SQLServer', set the SQL account in 'Computer > manage > SQL Server > Properties' to 'use this account'. Restarted Service.
  10. 创建一个名为“SQLServer”的新用户,将“Computer > manage > SQLServer > Properties”中的SQL账号设置为“use this account”。重新启动服务。
  11. Added SQLServer to Administrator group, and all the 'MSSQL' groups as well.
  12. 添加SQLServer到管理员组,以及所有的“MSSQL”组。
  13. Tried logging in with .\SQLServer and password that I set for SQL authentication method, no luck.
  14. 尝试使用。\SQLServer和我为SQL身份验证方法设置的密码登录,没有运气。
  15. Tried logging in with SQLServer and password, no luck either.
  16. 尝试使用SQLServer和密码登录,也没有成功。

I also tried installing "Service Pack 1 of SQL Server 2008", but no luck.

我也尝试了安装“SQL Server 2008的Service Pack 1”,但是没有成功。

Essentially, I cannot figure out how to login to my own local MSSQL server.

基本上,我不知道如何登录到我自己的本地MSSQL服务器。

3 个解决方案

#1


6  

Follow the steps in Troubleshooting: Connecting to SQL Server When System Administrators Are Locked Out:

执行故障排除步骤:当系统管理员被锁定时连接到SQL Server:

  • Start the instance of SQL Server in single-user mode by using either the -m or -f options.
  • 使用-m或-f选项以单用户模式启动SQL Server实例。
  • Start command prompt as local administrator
  • 作为本地管理员启动命令提示符
  • Connect to the server: sqlcmd -E -S .
  • 连接到服务器:sqlcmd -E -S。
  • Add yourself (computername\username) to the sysadmin SQL group:

    将自己(计算机名\用户名)添加到sysadmin SQL组:

    create login [computername\username] from windows;
    exec sp_addsrvrolemember 'computername\username', 'sysadmin';

    从windows中创建登录[计算机名称\用户名];exec sp_addsrvrolemember“computername \用户名”,“系统管理员”;

  • Restart the server in normal mode

    以正常模式重新启动服务器

And next time pay attention to the options you click during Setup.

下次注意你在安装过程中点击的选项。

#2


2  

Just to clear something up. The service account you keep changing is the account that SQL Server's services are running under on the computer and has nothing o do with what accounts are allowed to access it (this would be like changing the MySQL service to a root account and then a non-root account, so not an MS issue). As this has nothing to do with your ability to login (unless you have disabled the service somehow by giving it an account with limited rights), I would verify it is working and then leave that dialog alone.

只是为了澄清一些事情。你不断改变的服务帐户是SQL Server的服务的帐户下运行在电脑上和无关o与帐户可以访问它(这就像改变MySQL服务根帐户然后非根用户帐户,所以不是一个女士的问题)。由于这与您的登录能力无关(除非您以某种方式为其提供了一个具有有限权限的帐户来禁用该服务),我将验证它是否正常工作,然后将该对话框保留下来。

#3


1  

I would say take a look at this post http://sqlblog.com/blogs/andy_leonard/archive/2008/07/15/installing-sql-server-2008-rc0.aspx

我想说看看这篇文章http://sqlblog.com/blogs/andy_leonard/archive/2008/07/15/installing-sql-server-2008-rc0.aspx

and pay attention to this...notice the add current user and add... options??

注意这一点……注意添加当前用户并添加…选项? ?

Also notice mixed mode...it is all there

还要注意混合模式……这一切都是有

不能登录到SQL Server 2008,在Windows 7 x64。

You can also change the account after the fact in the service itself

您还可以在服务本身之后更改帐户。

#1


6  

Follow the steps in Troubleshooting: Connecting to SQL Server When System Administrators Are Locked Out:

执行故障排除步骤:当系统管理员被锁定时连接到SQL Server:

  • Start the instance of SQL Server in single-user mode by using either the -m or -f options.
  • 使用-m或-f选项以单用户模式启动SQL Server实例。
  • Start command prompt as local administrator
  • 作为本地管理员启动命令提示符
  • Connect to the server: sqlcmd -E -S .
  • 连接到服务器:sqlcmd -E -S。
  • Add yourself (computername\username) to the sysadmin SQL group:

    将自己(计算机名\用户名)添加到sysadmin SQL组:

    create login [computername\username] from windows;
    exec sp_addsrvrolemember 'computername\username', 'sysadmin';

    从windows中创建登录[计算机名称\用户名];exec sp_addsrvrolemember“computername \用户名”,“系统管理员”;

  • Restart the server in normal mode

    以正常模式重新启动服务器

And next time pay attention to the options you click during Setup.

下次注意你在安装过程中点击的选项。

#2


2  

Just to clear something up. The service account you keep changing is the account that SQL Server's services are running under on the computer and has nothing o do with what accounts are allowed to access it (this would be like changing the MySQL service to a root account and then a non-root account, so not an MS issue). As this has nothing to do with your ability to login (unless you have disabled the service somehow by giving it an account with limited rights), I would verify it is working and then leave that dialog alone.

只是为了澄清一些事情。你不断改变的服务帐户是SQL Server的服务的帐户下运行在电脑上和无关o与帐户可以访问它(这就像改变MySQL服务根帐户然后非根用户帐户,所以不是一个女士的问题)。由于这与您的登录能力无关(除非您以某种方式为其提供了一个具有有限权限的帐户来禁用该服务),我将验证它是否正常工作,然后将该对话框保留下来。

#3


1  

I would say take a look at this post http://sqlblog.com/blogs/andy_leonard/archive/2008/07/15/installing-sql-server-2008-rc0.aspx

我想说看看这篇文章http://sqlblog.com/blogs/andy_leonard/archive/2008/07/15/installing-sql-server-2008-rc0.aspx

and pay attention to this...notice the add current user and add... options??

注意这一点……注意添加当前用户并添加…选项? ?

Also notice mixed mode...it is all there

还要注意混合模式……这一切都是有

不能登录到SQL Server 2008,在Windows 7 x64。

You can also change the account after the fact in the service itself

您还可以在服务本身之后更改帐户。