SQL authentication in SQL Server 2008 - sql-server

I have this problem.
I first connect(log) to SQL Server using SQL Management Studio the authentication is set to Windows Authentication.
Then I go to the Security => Logins folder and add a user, the authentication is: SQL Server authentication, I give him also the sysadmin role [all roles]
I try to login as that user, but I can't
I tried everything but no result
How can this be corrected?

You should enable SQL Authentication; it isn't enabled by default.
In SSMS, right-click on the top-level (server) node, select Properties. Then click on Security in the left-hand panel, then select the "SQL Server and Windows Authentication mode" radio button in the right-hand panel.

You also have to restart you sql server. For me it start working only after restart.

Related

Can't login in SQL Server Management Studio

I am trying to create a login in SQL Server Management Studio. I was successful in the creation, but after that I can't login in it. I will leave the steps below
Fixed the problem. Solution
Check your server Properties --> Security --> Server authentication
If SQL Server and Windows Authentication mode selected you will be fine.
If not, Follow steps below:
Right-click on your server
Go to option Security
Check the option "SQL Server and Windows Authentication mode"
Click on Ok button
Restart SQL Express Service ("Windows Key" on keyboard and write "Services", and then Enter key)
After SQL services restarted, you should be able to login with user and password
These are the steps to take to create a login:
Click right on database ,choose security , choose SQL with Windows authentication and Both failed....
Restart SQL Server service
Create database
Create login and a sign the name of database to the user from choosing "Default Database"
Be sure you a sign to user mapping database
Server name :
if local choose the name of computer name that you choose from first if you do not know choose from drop list of server name to see what available name
if you have a ip static put the server name like that :000.00.00.00\\SQLSERVER2019,1433, name and password.

how to protect database from windows authentication

I want to deploy .net application on client machine.I don't know how to protect my database from from windows authentication.
I want to access my database only from defined sqlserver authenticated user.
I am Using sqlserver 2008 R2.
From MSDN discussion:
You cannot disable Windows Authentication on SQL Server. In fact, SQL
Server recognizes two modes of security:
1) Windows Authentication
2) SQL Server AND Windows Authentication
There's a way out, however. Users of the Adminstrators group of
Windows are able to connect to the SQL Server because there's a login
account in SQL Server for it and is assigned the System Administrators
role. You'll need to delete that login. But before you do so, please
be sure that
1) the security mode is set to SQL Server and Windows, and
2) you know the password of SQL Server's sa login Otherwise, you'll render your SQL Server inaccessible!
To do so, follow these steps:
1) Open SQL Server Enterprise Manager
2) Expand the nodes to reveal your SQL Server instance
3) Expand your SQL Server instance node to reveal the various nodes
4) Expand the Security node and click Logins
5) Right-click the BUILTIN\Administraors login and click Delete, click Yes
when prompted for confirmation

Cannot login after creating the user in SQL Server

My problem is I cannot login into SQL Server after I've created a user. The user creation is successful, since the new user is listed under security/logins.
How to solve this issue ???
Login failed for user 'sims'. The user is not associated with a
trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)
SQL Server was not configured to allow mixed authentication. Here are steps to fix:
Right-click on SQL Server instance at root of Object Explorer,
click on Properties.
Select Security from the left pane.
Select the SQL Server and Windows Authentication mode radio button, and
click OK.
Open up Services and restart the SQL Service (SQLEXPRESS) Windows service.
Try setting your authentication mode to mixed mode. Your server does probably not accept logins using sql server accounts.
Open properties
Go to "Security"
Select "SQL Server and Windows Authentication mode"
Right click Server for properties...
properties

SQL Server 2008 can't login with newly created user

I'm using using Windows Vista and I'm having trouble logging in with a newly created user.
I open SQL Server Management Studio.
I create a new Login by right-clicking on Security->Logins.
Check: SQL Server Authentication
Login name: tester
Password: test
Click OK
I added this user to User Mapping to my database of choice.
Click File -> Connect Object Explorer, select SQL Server Authentication and enter tester/test and click Connect.
I get an error:
Login failed for user 'tester'. (Microsoft SQL Server, Error: 18456"
with Severity = 14 and State = 1.
What causes this error and how do I login with my user?
SQL Server was not configured to allow mixed authentication.
Here are steps to fix:
Right-click on SQL Server instance at root of Object Explorer, click on Properties
Select Security from the left pane.
Select the SQL Server and Windows Authentication mode radio button, and click OK.
Right-click on the SQL Server instance, select Restart (alternatively, open up Services and restart the SQL Server service).
This is also incredibly helpful for IBM Connections users, my wizards were not able to connect until I fxed this setting.
If you haven't restarted your SQL database Server after you make login changes, then make sure you do that. Start->Programs->Microsoft SQL Server -> Configuration tools -> SQL Server configuration manager -> Restart Server.
It looks like you only added the user to the server. You need to add them to the database too. Either open the database/Security/User/Add New User or open the server/Security/Logins/Properties/User Mapping.
You'll likely need to check the SQL Server error logs to determine the actual state (it's not reported to the client for security reasons.) See here for details.
Login to Server as Admin
Go To Security > Logins > New Login
Step 1:
Login Name : SomeName
Step 2:
Select SQL Server / Windows Authentication.
More Info on,
what is the differences between sql server authentication and windows authentication..?
Choose Default DB and Language of your choice
Click OK
Try to connect with the New User Credentials, It will prompt you to change the password. Change and login
OR
Try with query :
USE [master] -- Default DB
GO
CREATE LOGIN [Username] WITH PASSWORD=N'123456', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=ON, CHECK_POLICY=ON
GO
--123456 is the Password And Username is Login User
ALTER LOGIN [Username] enable -- Enable or to Disable User
GO

sql server 2008 express/enterprise

I am logged with windows authentication and create an entry/user in the login table.
The new testuser has a sql-server authentication, but if a try to login local or remote, only fault 18456.
Is there any trick... this should be so simple as explained... but should work?
i believe it's just that the SQL server authentication is disabled by default installation. go check your SQL server properties in management studio (right-click on the server in object explorer, then select 'properties'), select 'security' menu in the left panel. you have the 'server authentication' option on the top of the right-side options panel with 2 options. make sure that the 'SQL server and windows authentication mode' is selected, not the 'windows authentication mode' which is default.
I don't quite understand your question - can you clarify a bit?
You're logged in with a Windows account - so does that Windows account (or a Windows group it belongs to) have a "login" in SQL Server?
How do you try to login with the new "testuser" ? How are you trying to connect? From an ADO.NET application? SQL Server Management studio?? Error 18456 can mean "login failed" - does your "testuser" have a SQL login? And is that login allowed to use the database you're trying to use??
Please give us a bit more information to go on - thanks!
Marc

Resources