Home / Thủ thuật máy tính / Other / Lỗi không đăng nhập được account “sa” khi mới cài SqlServer 2008

Lỗi không đăng nhập được account “sa” khi mới cài SqlServer 2008



Sau khi cài Sqlserver 2008 xong, ta không thể login bằng account “sa” được mặc dù lúc cài đã set password cho nó.

Quái lạ nhỉ? thằng SqlServer các version trước nó cài xong vào sa bình thường mà?

Nguyên nhân: do user “sa” tự động bị disable khi cài Sqlserver 2008 (chắc mấy chú hacker mò password của tài khoản này ghê quá nên MS disable cho nó chắc, ai biết thì mở ra xài).

PS: Để tránh bị hacker đột nhập dễ dàng, không nên đặt password dễ nhớ như sa hay 123456

 Cách giải quyết:

Bước 1: Login Sqlserver bằng quyền admin của Windows (chọn chế độ Authentication là “Windows Authentication”).

Bước 2: Chọn Security => Logins, double – click lên sa sẽ hiện lên hộp thoại “Login Properties – sa”, chọn mục Status, ta sẽ thấy nó bị Disable, ta phải chọn lại là “Enabled” =>OK

Bước 3: right-click vào “[Tên máy tính của bạn]\SQLExpress”, chọn Properties, tìm đến mục Security, chọn “SQL Server and Windows Authentication Mode” => OK

Bước 4: Restart lại SQL service. (Note: Bước này khá quan trọng nhé)

XONG.

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

Cũng có 1 bài viết bằng tiếng anh, người ta cũng hướng dẫn giống mình, post lên “FOR FOREIGNER – ENGLISH VERSION HERE”

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

When installing Visual Studio 2005 or Visual Studio 2008, the installer will automatically install for us one instance of SQL Server 2008 Express. But we can’t actually connect the database without extra tools and we can’t login except using Integrated Security. In this article I will explain how to download extra tools and how to login using sa account (not Windows Authentication Mode).

1. First download Management Studio Express for SQL Server Express 2005, http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796&displaylang=en  this tool will enable you to connect with SQLExpress instance that is installed via Visual Studio. Install this tool and you can connect to database [MyComputerName]\SQLEXPRESS but for first you will need to use Windows Authentication mode. This way you can connect to the instance.

2. After success connecting the database, Open Security tree, Logins tree and you can see sa account. Double click ‘sa’ account and from General page, change the Password and Confirm Password to new password that you want. Then change to Status page, on Login section select Enabled. Then click OK.

3. Now right click the [MyComputerName]/SQLExpress and select Properties then open the Security page, on Server Authentication section select SQL Server and Windows Authentication Mode.

4. Open Services diaog box, (on Control Panel open Administrative Tools, then Services). Select the SQL Server (SQLEXPRESS) service, restart this service.

5. Now you can connect to SQLEXPRESS instance using Management Studio via sa account and new password you set.

Ref: http://www.trap17.com/index.php/Resolving-Can39t-Login-Sqlexpress-Sa-Account_t61695.html

Leave a Reply

Your email address will not be published. Required fields are marked *