Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot create SQL Server Express Login - Login Failed for User

Tags:

I have created a new login for SQL Server Express as follows:

USE [master] GO CREATE LOGIN [Test] WITH PASSWORD=N'SF#$%GD%^J675JFS4fds'      MUST_CHANGE,      DEFAULT_DATABASE=[master],      CHECK_EXPIRATION=ON,      CHECK_POLICY=ON GO  ALTER SERVER ROLE [sysadmin] ADD MEMBER [Test] GO  USE [master] GO  CREATE USER [Test] FOR LOGIN [Test] GO  USE [master] GO  ALTER ROLE [db_securityadmin] ADD MEMBER [Test] GO 

When I try to connect via the Test login, I receive the error message that

Login failed for user 'Test'

Connect as new Test Login

like image 696
Shaun Luttin Avatar asked Apr 17 '15 21:04

Shaun Luttin


1 Answers

I needed to configure the server for SQL Server and Windows Authentication Mode.

  1. Open SSMS.
  2. Connect to the server via Windows Authentication.
  3. Right click the server and choose Properties.
  4. Change to "SQL Server and Windows Authentication Mode"

SQL Server and Windows Authentication Mode

See also: http://www.microsoft.com/products/ee/transform.aspx?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456

like image 179
Shaun Luttin Avatar answered Sep 22 '22 17:09

Shaun Luttin