I recently replaced an on-prem MySQL server with Azure Database for MySQL. I have a .NET 6 C# application and it works when connected to the on-prem, but has a problem with the Azure DB. Both databases are version 5.7.32.
When the app is connected to the Azure DB, all of the SQL queries work except for one. That one SQL query throws the error shown below. The query is pretty ugly and has a lot of joins and nested selects, but it works with the on-prem. I can get the query to work if I remove some of the joins.
Is there anything else I can do to troubleshoot this or get a better understanding of what the problem is? Right now, it looks like I have to refactor the query, but I really would like more detail on what the problem was.
MySql.Data.MySqlClient.MySqlException
HResult=0x80004005
Message=Fatal error encountered during command execution.
Source=MySql.Data
StackTrace:
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
at XXXX.cs:line XXXX
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
MySqlException: Fatal error encountered attempting to read the resultset.
Inner Exception 2:
MySqlException: Reading from the stream has failed.
Inner Exception 3:
IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond..
Inner Exception 4:
SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.