139
votes
Connect to SQL Server with Windows Authentication in a different domain
There is another way, which I now use in preference to the runas /netonly method.
You can add the credentials to your profile in Windows using the Credential Manager found in the Windows control panel....
98
votes
Accepted
Connect to SQL Server with Windows Authentication in a different domain
You are attempting to pass Windows credentials in plain text from the connection string of an application. This simply isn't how Windows authentication works, and largely defeats the purpose.
You ...
35
votes
Mongo Create a user as admin for any database raise an error
The '...AnyDatabase' roles should be added to the admin database for the user:
use admin
db.createUser({ user: "mongoadmin" , pwd: "mongoadmin", roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "...
33
votes
Accepted
What is mysql_native_password?
For a long time, MySQL has supported different authentication plugins, basically programable pieces of code to demonstrate that a mysql accounts is owned by whoever claims so.
The original way to do ...
24
votes
Accepted
The certificate chain was issued by an authority that is not trusted
On connection pop up click on options
Then make sure the "Trust server certificate" is checked
20
votes
Error: Cannot Generate SSPI context
'Cannot generate SSPI context' is a generic error. It can be caused by many issues, like an outaded password, clock drift, Active Directory access permissions, failure to register an SPN and so on and ...
19
votes
Accepted
Azure SQL Database "Login failed for user" in application, but works fine in SSMS
We found that with contained databases / contained users you must specify:
GRANT CONNECT TO [YOUR_USER]
Otherwise CONNECT seems to be revoked by default. Once we made the above change, we could ...
18
votes
Accepted
psql: FATAL: Peer authentication failed for user
In a fresh install from a few days ago, the second line of my pg_hba.conf is
local all all peer
I believe this is the one that makes your connection attempt fail.
The ...
18
votes
Determine whether mixed mode auth is enabled without logging in?
You can check it in the registry:
HKLM\Software\Microsoft\Microsoft SQL Server\ [instancename] \MSSqlServer
The current mode is recorded in the LoginMode key.
Values (DWORD) can be:
1 = Windows ...
17
votes
Cannot log in using SA with SQL Authentication
Did you look anywhere? Right-click the server and choose Properties, then select the Security screen.
Then, log in using your Windows auth admin account, and set the password for the sa SQL auth ...
15
votes
Accepted
Determine whether mixed mode auth is enabled without logging in?
Another approach is to try logging in, using SQL authentication, with an obviously fake account that won't succeed. You can then use notepad to open up the ERRORLOG file in C:\Program Files\Microsoft ...
13
votes
Access denied for user 'root'@'%'
I know what you did.
Do this:
SELECT `User`, `Grant_priv` FROM `mysql`.`user` WHERE `User` = 'root';
You will probably notice it returns a 'N' for Grant_priv. So do this:
UPDATE `mysql`.`user` ...
12
votes
Accepted
Can I connect to the database as the user "dbo"?
The first part to understand is the difference between a User and a Login in SQL Server. This article provides a brief rundown to understand the difference, but to put it simply, a Login is a server-...
11
votes
Accepted
Locked my sa user out
There are two ways to handle this.
One option is to login to the windows machine as a local administrator, start SQL Server in single user mode (-m startup switch) and you will now be able to get ...
10
votes
Accepted
How to prevent a login from 'listing' a table or view definition in PostgreSQL?
The documentation to the rescue:
UPDATE
[...]
For schemas, allows access to objects contained in the specified schema (assuming that the objects' own privilege requirements are also met). Essentially ...
8
votes
MYSQL ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol ref used (client option 'secure_auth' enabled)
On the command line, use something like the following, if you have no choice...
mysql -uTheUseerNAme -pThePassword DbName -h HostName --skip-secure-auth
Hope this helps someone, as this was my ...
8
votes
Mongo authentication user can't drop database
Grant your user the "root" role and you will be able to delete the dbs. You do NOT have to disable authentication to do this, as long as you have an admin account this will work.
use admin;
...
8
votes
Accepted
sql server authentication login failed
Connect to SQL Server using Windows authentication. Run sp_readerrorlog and see the complete message which would have come in errorlog when you tried connecting with SQL Authentication. This message ...
8
votes
Accepted
SQL Server SSL Encryption - SelfSign Cert working - why?
Traffic will be encrypted regardless of the client encryption specification when you turn on the Force Encryption option on the server side (SSCM-->SQL Server Network Configuration-->Protocols for ...
8
votes
Using host names in `pg_hba.conf`?
It's not sufficient that 195.249.206.131 resolves to kommune.horsholm.dk that matches the wildcard.
After checking that, Postgres will try to resolve kommune.horsholm.dk and find that it doesn't ...
7
votes
SQL Server 2012 Can't log in with machine account
It is most likely not the DOMAIN\computer$ at all. This message is known to be a misleading. I think all it wants is that "NT AUTHORITY\NETWORK SERVICE" be granted the server access. Open SQL Server ...
7
votes
Azure SQL Database "Login failed for user" in application, but works fine in SSMS
When switching our API to connect to an Azure database via a new contained user, we had to change our connection string to include:
Persist Security Info=True;
While I don't understand why this ...
7
votes
Who is the person using a SQL login?
No, if the user connects to SQL Server using a SQL Authentication login, there is no way to determine from that which Windows login was responsible. SQL Server can only record the information it has ...
6
votes
SQL Server 2012 Can't log in with machine account
Both @cha and @alt have right clues - the error message is misleading and Application Pool Identity is involved (well, at least it was in my case).
If your IIS app's application pool uses Application ...
6
votes
MYSQL ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol ref used (client option 'secure_auth' enabled)
If you use MySQL Workbench, you need to check this option:
6
votes
Accepted
credentials file for running mysql related jobs via script?
It would be better to store the credentials in a config file, and load them as an extra-defaults file:
$ mysqldump --defaults-extra-file=mycred.cnf ...
The config file is the same format as /etc/my....
6
votes
Accepted
Adding a local user account into SQL Server
This has nothing to do with SQL Server, is just basic Windows authentication. In a workgroup you can only authenticate using NTLM mirrored accounts. Mirrored accounts are local accounts that have ...
6
votes
Accepted
SQL Server 2008R2 Alias not working
Summarizing what we discovered in the chat.
When connecting over the network if the Windows Server is registered in Active Directory (AD) with a Service Principal Name (SPN), clients that try to ...
6
votes
Accepted
SQL Server, connecting without windows authentication?
Windows Authentication is always available, SQL Server Authentication is only available if Mixed Mode is enabled.
During setup, you must select an authentication mode for the Database Engine. There ...
6
votes
How to get psql to prompt for a password with the superuser postgres?
why when I log as a normal user it asks for a password and doesn't when i log as superuser?
it just doesn't seem safe at all.
The small but important detail that you're missing is that nobody ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
authentication × 330sql-server × 138
postgresql × 55
mysql × 45
security × 30
mongodb × 22
sql-server-2008 × 21
windows × 20
oracle × 19
sql-server-2008-r2 × 19
active-directory × 17
permissions × 13
connectivity × 13
linked-server × 12
users × 12
logins × 12
kerberos × 12
sql-server-2014 × 10
password × 10
sql-server-2012 × 9
db2 × 8
authorization × 8
sql-server-2005 × 7
ssms × 7
role × 7