Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 'Login failed for user'

Author  Topic 

ozzie
Starting Member

2 Posts

Posted - 2013-01-02 : 14:26:51
I have problem setting up a new user on my local ms sql express.

- I have my sql server instance configured to SQL Server and Windows authentication mode
- I create a new login, with SQL Server authentication, choose a password and unmark 'enforce password policy'. And also specify a default database.
- I then go to my database (in management studio) and create a new user with the same name as my just created login, select also the later, and choose db_owner for database role.
- And specify my connectionstring like:
<add name="TestConnection" connectionString="Data Source=(Local)\SQLEXPRESS;Initial Catalog=MyDatabase;User ID=username;Password=pwd;" providerName="System.Data.SqlClient"/>

ovc
Starting Member

35 Posts

Posted - 2013-01-02 : 16:48:22
1. did you try to connect with SSMS with that account and does the authentication work?
2. did you try the connection using a udl file?
3. does it work locally?

you could try to get more info using the profiler trace, but it is hard from your description to figure out what exactly the issue might be.

Could you paste the exact error message?
Go to Top of Page

ozzie
Starting Member

2 Posts

Posted - 2013-01-06 : 07:38:11
Thanks, I missed to restart my server for configuration changes to take place.

So now I am able to set up a login-user on my local sql instance.

But when I try to connect to my remote server I got this error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


I am able to login with my user to SSMS, have enabled named pipes and TCP/IP and allowed remote connections.
In Configuration Manager I see that SQL Server Agent and SQL Server Browser are stopped, with start mode: Other(...
don't know if that could be the causes.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-01-06 : 11:31:19
Check this throubleshooting guide on this error : http://www.sqlserver-dba.com/2012/05/cannot-connect-to-sql-server.html

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -