❔ SQL Timeout Error Deployed ASP.NET Core app

Aaaarianme2/8/2023
i just deployed my web app with react and .net core and it runs locally but when i run it on the server i get this error
TimeoutException: The operation has timed out.
Unknown location
MySqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
MySql.Data.Common.StreamCreator.GetTcpStream(MySqlConnectionStringBuilder settings, ref MyNetworkStream networkStream)

MySqlException: Unable to connect to any of the specified MySQL hosts.
MySql.Data.MySqlClient.NativeDriver.Open()

https://sptwebapp.azurewebsites.net/login/master
anyone knows why
A/CAtakan / Cracker2/8/2023
it looks like failing to connect MySql server
A/CAtakan / Cracker2/8/2023
any chance your connection string is localhost ? (dont share your conection string if its public though)
A/CAtakan / Cracker2/8/2023
where do you host MySql
BBananaPie2/8/2023
can you try to use MySQL workbench to see if you can connect to it?
Aaaarianme2/8/2023
yes that all works
Aaaarianme2/8/2023
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder
{
Server = "myapp.mysql.database.azure.com",
Database = "dbname",
UserID = "name",
Password = "pass",
SslMode = MySqlSslMode.Required,
};
Aaaarianme2/8/2023
this is how i connect so the con string is right
AAccord2/9/2023
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.