DB mysql with my web app dotnet

Hi,
I successfully deployed my asp dotnet webapp on render, and I was also able to deploy my mysql db on render as a private service, my two services are on the same account in the same region. I was able to connect to the database and configure it with ssh on the terminal. But I can’t connect my webapp to this database, it gives me a connection refused. Here is my connection string: “DefaultConnection”: “Server=localhost;Database=${MYSQL_DATABASE};User=${MYSQL_USER};Password=${MYSQL_PASSWORD};”

Can you help me please.

Hi,

Running your own MySQL server on a Private Service wouldn’t have the server on localhost, as your connection string shows, it would use the private network hostname. More on the Private Network in the docs: https://docs.render.com/private-network

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.