Hi, i got the following error msg while trying to return data from mysql database (within 180 seconds).
ERROR [HY000] [MySQL][ODBC 8.0(w) Driver][mysqld-8.3.0]Query execution was interrupted, maximum statement execution time exceeded
Its only took approx 47 seconds if i execute this query in phpmyadmin. I have increase mysql execution time by using this SET GLOBAL MAX_EXECUTION_TIME=300000; The following is how i execute mysql statement in my ASP.NET application
Public Function return_tuote_table() As DataTable
Dim ConnStr As String = ConfigurationSettings.AppSettings("database").ToString
Dim MyConn As New OdbcConnection(ConnStr)
Dim mydataadapter As OdbcDataAdapter
Dim mydatatable As DataTable
If action = "search" Then
Str = "SELECT *, " & _
"(SELECT name1 FROM product_general pg WHERE pg.PID = tg.access) as contestInfo, " & _
"(SELECT CONCAT(name1, ' (', mobile, ')') FROM customer_detail cd WHERE cd.CID = tg.CID) as customerInfo, " & _
"(SELECT name1 FROM distributor_general dg WHERE dg.DID = tg.agentID) as distributorInfo, " & _
"(SELECT name1 FROM stock_general sg WHERE sg.PID = tg.PID) as stockInfo " & _
"FROM tuote_general tg WHERE tg.merchantID = '70004' AND tg.CODE = '23 JAN 2024' AND tg.award_status = 'Yes' ORDER BY tg.refID ASC LIMIT 0, 1000"
End If
Try
mydataadapter = New OdbcDataAdapter(Str, MyConn)
mydatatable = New DataTable
mydataadapter.Fill(mydatatable)
Catch ex As Exception
errormsg = ex.Message
End Try
If Not MyConn Is Nothing Then
MyConn.Close()
End If
Return mydatatable
End Function