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....
user avatar
  • 3,383
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 ...
user avatar
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", "...
user avatar
  • 1,225
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 ...
user avatar
  • 14k
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
user avatar
  • 356
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 ...
user avatar
  • 50.8k
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 ...
user avatar
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 ...
user avatar
  • 28.7k
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
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` ...
user avatar
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-...
user avatar
  • 9,232
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 ...
user avatar
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 ...
user avatar
  • 28.7k
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 ...
user avatar
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; ...
user avatar
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 ...
user avatar
  • 18.3k
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 ...
user avatar
  • 24.1k
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 ...
user avatar
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 ...
user avatar
  • 1,035
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 ...
user avatar
  • 171
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 ...
user avatar
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 ...
user avatar
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:
user avatar
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....
user avatar
  • 9,248
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 ...
user avatar
  • 50.8k
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 ...
user avatar
  • 1,731
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 ...
user avatar
  • 69.1k
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 ...
user avatar
  • 6,469

Only top scored, non community-wiki answers of a minimum length are eligible