C
C#7mo ago
randombev

✅ How to create a database for an application on mac?

The application’s purpose is to allow entry and editing of customer details
39 Replies
Angius
Angius7mo ago
What kind of a database? SQLIte? PostgreSQL? SQL Server?
randombev
randombev7mo ago
for dotnet project i am using visual studio for mac atm
x0rld
x0rld7mo ago
you have to chose a database engine
Angius
Angius7mo ago
A dotnet project can use any database So, again, which one?
randombev
randombev7mo ago
i tried using XAMPP and phpmyadmin
Angius
Angius7mo ago
Yes, you can run a MySQL database through XAMPP
randombev
randombev7mo ago
but I cant follow at 17.40 tried using chatgpt but still i got this error "Option 'cache' not supported"
PhantomRow
PhantomRow7mo ago
You can try Mssql management studio for mac? Setup? Maybe ? for mssql tsql
randombev
randombev7mo ago
i think I have to be in "(base)" in terminal? not im not sure how
x0rld
x0rld7mo ago
show how your register your dbcontext
Angius
Angius7mo ago
You need to be in your project's directory In the project that has the DbContext, to be more precise
randombev
randombev7mo ago
using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using ardonagh.Data; var builder = WebApplication.CreateBuilder(args); // Add services to the container. var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found."); //builder.Services.AddDbContext<ApplicationDbContext>(options => // options.UseSqlite(connectionString)); builder.Services.AddDbContextPool<ApplicationDbContext>(options => options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString))); builder.Services.AddDatabaseDeveloperPageExceptionFilter(); builder.Services.AddDefaultIdentity<IdentityUser>(options => options.SignIn.RequireConfirmedAccount = true) .AddEntityFrameworkStores<ApplicationDbContext>(); builder.Services.AddControllersWithViews(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.UseMigrationsEndPoint(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); app.MapRazorPages(); app.Run();
Bing
The birthplace of Western philosophy
On World Philosophy Day, we're in Athens, the capi
x0rld
x0rld7mo ago
what's your connection string ?
randombev
randombev7mo ago
No description
Angius
Angius7mo ago
That seems fine What is the exact error you're getting?
MODiX
MODiX7mo ago
bernicefy#1744
i am using visual studio for mac atm
React with ❌ to remove this embed.
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
Angius
Angius7mo ago
Should have no bearing on the errors thrown from a dotnet tool ran via CLI, should it? But, yeah, VS4Mac is dead
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
x0rld
x0rld7mo ago
the devkit vscode extension has been release btw
jcotton42
jcotton427mo ago
SSMS does not exist for macOS closest thing would be Azure Data Studio
randombev
randombev7mo ago
this is the error after i enter "dotnet ef migrations add Customer" Will it fix the problem if i switch to Azure Data Studio instead of XAMPP?
x0rld
x0rld7mo ago
no
jcotton42
jcotton427mo ago
ADS is a database client not a database engine
randombev
randombev7mo ago
hmm.. so what should I do? I am stuck here..
x0rld
x0rld7mo ago
what's the line 13 ?
randombev
randombev7mo ago
No description
x0rld
x0rld7mo ago
try removing it
randombev
randombev7mo ago
still the same error is this the cause of the problem?
Angius
Angius7mo ago
No, unlikely
randombev
randombev7mo ago
so it's a a database engine problem?
Angius
Angius7mo ago
It seems that way, yeah Like MySQL wasn't supporting whatever option What version of MySQL do you have installed?
randombev
randombev7mo ago
AHHH thank youuuu for reminding its working now :'))
x0rld
x0rld7mo ago
what did you change ?
randombev
randombev7mo ago
SQL connection From MySQL Workbench
x0rld
x0rld7mo ago
oh the connectionstring ?
randombev
randombev7mo ago
yup
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View