SQL Server中伺服器身分識別驗證及使用者登入,sqlserver

來源:互聯網
上載者:User

SQL Server中伺服器身分識別驗證及使用者登入,sqlserver

安裝過程中,SQL Server 資料庫引擎設定為“Windows 身分識別驗證模式”或“SQL Server 和 Windows 身分識別驗證模式”。 安裝完成後,您可以隨時更改身分識別驗證模式。

如果在安裝過程中選擇了“Windows 身分識別驗證模式”,則 sa 登入名稱將被禁用,安裝程式會分配一個密碼。 如果稍後將身分識別驗證模式更改為“SQL Server 和 Windows 身分識別驗證模式”,則 sa 登入名稱仍處于禁用狀態。 若要使用 sa 登入名稱,請使用 ALTER LOGIN 語句啟用 sa 登入名稱並分配一個新密碼。 sa 登入名稱只能使用 SQL Server 身分識別驗證串連到伺服器。

參考:https://msdn.microsoft.com/zh-cn/library/ms188670.aspx更改伺服器身分識別驗證

更改安全身分識別驗證模式

啟用sa登入名稱

啟用 sa 登入名稱

解決串連失敗/添加使用者

當我們開啟“Microsoft SQL Management Studio"並嘗試串連伺服器的時候,如果遇到如下錯誤:

Cannpt connect to **

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

則可能相應的使用者沒有啟用,或者使用者名稱/密碼錯誤,或者使用者認證方式錯誤,或者使用者沒有系統管理權限。可以嘗試按照如下連結方式解決。

http://itproguru.com/expert/2014/09/how-to-fix-login-failed-for-user-microsoft-sql-server-error-18456-step-by-step-add-sql-administrator-to-sql-management-studio/

1)通過安裝時候的預設設定登入,使用Microsoft SQL Management Studio

2)Object Explorer中選擇”Security"->"Logins",找到相應的使用者名稱,點Property。如果沒有需要的使用者,則選擇“New Login",直接輸入使用者名稱或者通過Search找到該使用者


3)選擇使用者認證方式為Windows authentication或者SQL Server authentication(輸入密碼)

4)如果想讓該使用者具有可以進入Management Studio的許可權,則需要在”Server Roles“把sysadmin勾上

5)對於SQL Server authentication,在Status狀態中Login需要Enabled

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.