Cannot Login in SQL Server Management Studio, Error: 233 - sql-server

I changed authentication mode from "Windows Authentication" to "Windows Authentication and SQL Server Authentication" and also enabled "sa" user and changed it's password and defined another user.
But now when I want to login in SQL Server Management Studio, it will show me this error:
I restarted SQL services
I restarted windows
I changed authentication mode from windows registry (because I couldn't login and change it in Properties)

You should login with windows auth. again and you should change sa user permission in roles as system admin. at the end of this process you should restart again sql service in services.

You can't login because you have a bad setting of your sa user, so for fix this problem you have to do this
So you can login now. Then enter to properties of the server in the security page check windows authentication y also verify connection page and set to the default

Related

Change database authentication mode

I have a SQL Server Express database on my desktop that I use to test an old classic asp program. I need to change the authentication method from Windows authentication to password authentication. I have changed the server from windows auth to SQL Server and Windows auth mode and restarted the server. I went into security and added a new login for the database set the name and login and the default db to the db I need to be able to use password to login to. When I attempt to log in using SQL Authentication I get the error message
CANNOT OPEN USER DEFAULT DATABASE. LOGIN FAILED. LOGIN FAILED FOR USER ERROR 4064
I open the connection properties and changed the connect to db to the db for the password login and got the same message. I have searched the internet and tried ever solution I could find to no avail. What am doing wrong?
First of all see if the sql server was configured to received SQL Server Autentication (Mix Mode)
right clink at server at the management-> porperties -> security
choose the option below and restar the service
other commum problem to some connection it that the user was create with a wrong default database
open the security folder at the management-> Logins
Choose your the login and open the properties like this below
Tell me if it's works

New User in SSMS Can't Login

I have installed SSMS (v17.1), created a new login at Security -> Logins, changed mode on the server (server: OWNER) to mixed mode. But the username/password combination doesn't seem to work. New Database Query -> SQL Server Authentication -> enter username/password and get error: Cannot connect to OWNER. Login failed for user 'myusername'. HELP!
According to Change Server Authentication Mode when the authentication mode is changed the server has to be restarted. Until restart SQL Server is still using Windows only authentication mode and that is what we can read is SQL Server error log as the reason of 18456 "login failed for user (...)"
I got this to work by following the instructions here: https://serverfault.com/questions/422269/where-can-i-find-the-user-in-this-iis-error-login-failed-for-user-iis-appool-w
All I did was create a user on the database, named IIS APPPOOL\DefaultAppPool, and a login, also named IIS APPPOOL\DefaultAppPool, using Windows authentication, and pointed the user at the login and it worked. Frankly, I'm still not sure why my custom SQL Server user didn't work, but at least I can move forward with my project.

Use windows authentication in windows service

When running tomcat 7 as a windows service I can connect SQLServer with SQLServer Authentication but when connecting through Windows Authentication it seems to fail.
From what I know process running under windows services are user independent and run under a user named "SYSTEM" . Is there a way I can add SYSTEM to SQLServer users ?
Every thing seems to work if I run the code via Eclipse i.e. Under a user process.
You need to add a new Login of your Machine (Machine where your service is running) on MS SQL Server machine.
For example your are on domain "DomainName" and your hostname is "MachineName", you need to add a new Login "DomainName\MachineName$" on SQL Server. Note the $ sign at the end indicates that this is a computer name.
Follow the Steps below to add a new login on MS SQL Server:
Open SQL Server Management Studio and Login as 'sa' user.
Open Security -> Logins
Right Click on Logins and New Login...
Enter the Login name "DomainName\MachineName$" in General Tab
Select Windows Authentication radio box
Select tab "Server Roles" and check the box against "sysadmin"
OK and then Restart your SQL Server Service.

sql server 2008 enable sa user or windows administrator user

sa and windows administraor are disabled in sql server 2008
How can enable users?
I have access administrator to windows
Login into machine as Administrator , then login SQL Server via SSMS using Windows Authentication then
Goto Object Explorer --> Security --> Login --> sa --> (Right Click) Properties
here make sure Status for login in Enabled .
Note
Obviously you also have to make sure that SQL Server Authentication is also enabled.

Windows Authentication not working with SQL Server

I am trying to set up an SQL Server Login and User using Windows Authentication.
What I have done so far is as follows:
Added a new non-administrator account to my PC called "User1". The PC is called "DESKTOP" so the full username is "DESKTOP\User1"
Created an SQL Server login for this user using the "FROM WINDOWS" option to link the SQL Login to my PC login. The user is called e.g. "DESKTOP\User1."
Created a database level user for the SQL Server login using the "FOR LOGIN" option to link the user to the SQL Server login.
Verified that the new database user is not a member of the "SysAdmins" group and that the login is enabled and login access is allowed.
Logged out of my administrator Windows account and logged in as "User1". I successfully logged in.
Started SSMS, ensured the username set was "DESKTOP\User1" and that "Windows Authentication" was selected.
When I pressed "Connect" I was presented with an error which in the event log reads as follows:
Token based server access validation failed with an infrastructure error
Server Name: DESKTOP
Error Number: 18456
Severity: 14
State: 1
Line Number: 65536
Reading about this, there is a suggestion that this is a UAC error. So I ran SSMS as an administrator. On Windows 8.1 it then asks me to log in with the system adminstrators account - which works - but then I am logged into SQL Server as "DESKTOP\Administrator" and not "DESKTOP\User1".
Why can't Windows pass my non-administrator credentials to SQL Server and log me in? The point of this is so that (in the future "domain") users can access the SQL Server with non-administrator privileges and using Windows Authentication.
Thanks in advance.
The problem was that the BUILTIN\Users group had its login permission disabled.
This must override the individual user accounts. DESKTOP\User1 must be part of this group, and the group level permission overrode it.
I am assuming you have the following message in your SQL Server event log:
Login failed for users ‘DESKTOP\User1’. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: xxx.xxx.xxx.xxx]
Error: 18456, Severity: 14, State: 12
State 12 means that SQL Server was able to authenticate you, but weren’t able to validate with the underlying Windows permissions.
Try logging into the server as the admin and running the following:
GRANT CONNECT SQL TO [DESKTOP\User1];
GRANT CONNECT ON ENDPOINT::"TSQL Default TCP" TO [DESKTOP\User1];

Resources