kr1sto__
kr1sto__
RRailway
Created by kr1sto__ on 8/3/2023 in #✋|help
Unable to connect and interact with MySQL database in .NET deployment
Hello, this is for project: 1fec3643-c053-45ed-917f-90449a8054a5 I have an app I've deployed along with a MySQL database. I have confirmed the migrations went through and I can connect locally either with CLI or via local host. Upon deployment however, I am getting nothing but 404 errors. I have been working on debugging for a while and am not sure what to try next. My appsettings.json has the connection string as follows (password redacted): { "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*", "ConnectionStrings": { "RAILWAY_MYSQL_CONNECTIONSTRING": "Server=containers-us-west-68.railway.app;Port=7055;Database=railway;Uid=root;Pwd=**;" }, "TokenSecretKey": "secret_dandelion_disco" } My program.cs is using the following to make the connection: var connectionString = builder.Configuration.GetConnectionString("RAILWAY_MYSQL_CONNECTIONSTRING"); builder.Services.AddDbContext<ClothingInventoryContext>(options => options.UseMySQL(connectionString)); I have connected to MySQL via railway with node.js and Spring Boot apps in the past, without issue. But this one seems to be giving me trouble. Any help would be greatly appreciated! Thank you in advance for any time and assistance you can offer me here.
126 replies