1

I was looking everywhere and still have not found clear answer to this simple question:

Is it possible to use SQL authentication with LocalDB, i.e. is it possible to use connection string containing

Integrated Security=False

?

leppie
  • 115,091
  • 17
  • 196
  • 297
Vojtěch Dohnal
  • 7,867
  • 3
  • 43
  • 105

1 Answers1

2

Yes, last I tried it was possible. Just follow the steps from this MDSN article.

Keep in mind that it will still be user instance, running under the account that started it, and will be shut down shall the account log out. Also no remote access.

Krzysztof Kozielczyk
  • 5,887
  • 37
  • 28
  • So when the LocalDB engine instance is created automatically, it is created in mixed auth mode, I see. I suppose I can then e.g. change sa password and login as sa. Do you think it is possible to attach preconfigured mdf database file, so that it does not allow access using windows auth for current user and allows only e.g. sa account? I would have to somehow create login-user mapping, right? – Vojtěch Dohnal May 20 '14 at 10:47
  • 2
    The instance is created in Integrated Auth mode. This is per-instance, not per-database setting. I suspect you're trying to prevent the user from accessing data in their database - there is no way of doing it in LocalDB. The instance runs under user account, and the account has to have access to the database file. Once the user has access to database file, they can spin up their own LocalDB instance and open the database, and it's all theirs from this moment. – Krzysztof Kozielczyk May 20 '14 at 17:49
  • Yes, I wanted to make it more difficult to open the local database. Appearently it is not worth the effort. – Vojtěch Dohnal May 21 '14 at 11:20
  • 2
    @KrzysztofKozielczyk This is horrible to hear. Are you saying that LocalDB can't be ran with "Integrated Security=False"? Microsoft deprecated SQ Compact for LocalDB and now I find out that LocalDB is not secure. Meaning that any user that gets a copy of the database can use their local Windows account to get into the database since it by default allows integrated security... – goroth Nov 20 '15 at 03:47