I have a problem connecting to LocalDb
using the LOCAL SERVICE
account.
Cannot open database "MyDB" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\\LOCAL SERVICE'.
The service looks like this:
connectionString:
Server=(localdb)\mssqllocaldb;Database=MyDB;Trusted_Connection=True;MultipleActiveResultSets=true
I have created the user NT AUTHORITY\\LOCAL SERVICE
in LocalDb
and mapped the user as db_owner
to the current databases. I have also checked that the login is enabled and has permission to connect to the database engine. I have also tried granting the user the sysadmin
server role.
I have restarted both the service and the computer but I still get the same error.
If I change the service to use my local computer account everything works. What have I missed?
I have followed this guide but with LocalDb
and NT AUTHORITY\\LOCAL SERVICE
instead.
Local Service account is not supported for the SQL Server or SQL Server Agent services. Instead, use a domain account or local account with the most restrictive permission set.
See this .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.