❔ dotnet ef database update not working on MAC.

Hello I'm working in visual studio with .net 6, working with EF. I'm having troubles getting my project to work. Im trying to sudo dotnet ef database update. I'm getting a error to error to new error 😛 The problem I'm running into are: (Errors) - CREATE DATABASE permission denied in database 'master' - Invalid value for key 'Trust Server Certificate' turned on 'accept non-trusted certificates automatically in Datagrip - Cannot authenticate using Kerberos. Ensure Kerberos has been initialized on the client with 'kinit' and a Service Principal Name has been registered for the SQL Server to allow Kerberos authentication. ErrorCode=InternalError My connection string:
builder.Services.AddDbContext<DomainContext>(options =>
{
options.UseSqlServer(@"Server=.;Database=YourDatabaseName;
User ID=thomas2;Password=strongpassword2023!;
Trusted_Connection=False;
TrustServerCertificate=True
MultipleActiveResultSets=True;
Encrypt=True;

");
});
builder.Services.AddDbContext<DomainContext>(options =>
{
options.UseSqlServer(@"Server=.;Database=YourDatabaseName;
User ID=thomas2;Password=strongpassword2023!;
Trusted_Connection=False;
TrustServerCertificate=True
MultipleActiveResultSets=True;
Encrypt=True;

");
});
simply just lost by now.. 😦 pls help
3 Replies
Tostiapparaat
TostiapparaatOP2y ago
Origin of the connection string was this before i tried googling and adding abunch of stuff trying to get it to work:
builder.Services.AddDbContext<DomainContext>(options =>
{
options.UseSqlServer(@"Data Source=.;Initial Catalog=TheCircleDomainDB;
Integrated Security=True; TrustServerCertificate=True");
});
builder.Services.AddDbContext<DomainContext>(options =>
{
options.UseSqlServer(@"Data Source=.;Initial Catalog=TheCircleDomainDB;
Integrated Security=True; TrustServerCertificate=True");
});
On this i get the Kerberos error as mentioned earlier.
Pobiega
Pobiega2y ago
Kerberos... thats an auth manager, isnt it? Anyways, I'd focus on
CREATE DATABASE permission denied in database 'master' Invalid value for key 'Trust Server Certificate'
for now. Look at your connectionstring, you are missing a ;
Trusted_Connection=False;
TrustServerCertificate=True
MultipleActiveResultSets=True;
Trusted_Connection=False;
TrustServerCertificate=True
MultipleActiveResultSets=True;
thats why its complaining about TrustServerCertificate
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server