C
C#3y ago
V3NG3ANC3

Newly hosted .net web app (Linux VPS) not accessing MySqlDatabase

I've just published a .Net web application to a linux VPS, however for some reason, when loading pages that require the database, the website is crashing. I know this is likely due to my database not being connected properly. It works fine on my local machine, just not on the Linux VPS. Any help would be greatly appreciated! Here is my appsettings.json (edited out sensitive info):
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Persist Security Info=False;Server=sql1.hosting.net;User ID=Website;Password=Password;Initial Catalog=myDatabase;MultipleActiveResultSets=true",
}
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Persist Security Info=False;Server=sql1.hosting.net;User ID=Website;Password=Password;Initial Catalog=myDatabase;MultipleActiveResultSets=true",
}
}
4 Replies
Kouhai
Kouhai3y ago
@V3NG3ANC3 Make sure that connection string is valid and can connect
V3NG3ANC3
V3NG3ANC3OP3y ago
Its definitely valid, it connects fine on my test server
Kouhai
Kouhai3y ago
Your DB is hosted on the VPS?
pip
pip3y ago
it would help you a lot to log the errors to a text file or console or something my guess is that it may be an outbound rule error? but that's just a pure guess
Want results from more Discord servers?
Add your server