Local SQL Server installed by other user account, how to access from new user account

女生的网名这么多〃 提交于 2019-12-11 03:13:45

问题


    • SQL Server was installed on the local PC by User1.
    • User1 has now left the company and a new account on the PC was created called User2.
    • User2 cannot access the local SQL Server installation.

Is it possible for User2 to access the local SQL Server without reinstalling?

Here is the error:

Cannot connect to mydatabasename.

Login failed for user 'myuser2name'. (.Net SqlClient Data Provider)

Server Name: mydatabasename

Error Number: 18456

Severity: 14

State: 1

Line Number: 65536

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


回答1:


The easiest way would be to log in via the "sa" account but I expect you don't have the password to this or it isn't enabled.

If you start the server in single-user mode you will be able to add additional users without reinstalling.

This MSDN page outlines all the steps but in brief they are

  1. Stop all services for that instance (including Sql Agent and Integration services) using "Sql Server Configuration Manager"
  2. Open up the properties window for the Sql Server instance you need to modify.
  3. Add an additional startup parameter "-m"
  4. Start the service (make sure you only start the Sql Server service)
  5. Start SSMS using "Run as Administrator"
  6. Connect to server using windows auth.
  7. Add login.
  8. Remove -m parameter from service and restart all services stopped above.


来源:https://stackoverflow.com/questions/28090747/local-sql-server-installed-by-other-user-account-how-to-access-from-new-user-ac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!