List:MySQL ODBC« Previous MessageNext Message »
From:John Pearson Date:May 20 1999 4:32pm
Subject:random dropped connections via odbc from asp web page
View as plain text  
I am using the following snippet from a web page to access mysql:

------------
	DIM	StrName
	DIM StrPassword
	DIM QueryString
	DIM Found
	
	Found = FALSE
	StrName = Request.Form("LogonName")
	StrPass = Request.Form("password1")
		
	SET Session("WebData") = Server.CreateObject("ADODB.Connection")
	SET WDConn = Session("WebData")
	WDConn.Open( "WebData" )
	QueryString = "SELECT * FROM Cust_Logon WHERE LogonName='" &
StrName & "' AND Password='" & StrPassword & "'"
	
	SET WDRecs = WDConn.Execute( QueryString )
	Do While( Found = FALSE )
		if(WDRecs.Fields.Item("LogonName") = StrName) AND
(WDrecs.Fields.Item("Password") = StrPassword) Then
			Found = TRUE
		else
			WDRecs.MoveNext()
		end if
	Loop
	if( Found = TRUE ) Then
		Session.Contents("IP") =
Request.ServerVariables("REMOTE_ADDR")
		Session.Contents("CustID") =
WDRecs.Fields.Item("CustomerID")
		Session.Contents("Name") =
WDRecs.Fields.Item("LogonName")		
%>
		<!--#include virtual=/oscardev/customer.asp-->
<%
	else
		Response.Write( "<p>" )
		Response.Write( "You are not authorized to logon to this
page" )
		Response.Write( "</p>" )
	end if
	WDRecs.Close()
	WDConn.Close()
------

The connection to the mysql database will randomly but frequently get
dropped.  Tracing the myodbc
yields (truncated at the point the drop is announced, and some fields
edited out):

--------
| | >mysql_option
| | | enter: option: 0
| | <mysql_option
| | info: MyODBC Version 2.50.22  option_flag: 4  client_flag: 64
| <get_client_flag
| >mysql_real_connect
| | enter: host: XXXX  db: WebData  user: XXXXX
| | info: Server name: 'XXXXX'.  TCP sock: 3306
| | >_mymalloc
| | | enter: Size: 8192
| | | exit: ptr: 83a33d0
| | <_mymalloc
| | packet: Memory: 83a33d0  Bytes: 10 51 46 50 50 46 49 57 98 0 
| | info: mysql protocol version 10, server=10
| | >my_multi_malloc
| | | >_mymalloc
| | | | enter: Size: 84
| | | | exit: ptr: 83b0db8
| | | <_mymalloc
| | <my_multi_malloc
| | info: Server version = '3.22.19b'  capabilites: 12
| | info: user: poweruser
| | >_mymalloc
| | | enter: Size: 8
| | | exit: ptr: 83b0b48
| | <_mymalloc
| | info: raw_net_read returned -1,  errno: 0
| | error: Couldn't read packet: remain: 4  errno: 0  length: -1
alarmed: 0
| | error: Wrong connection or packet. fd: 2540  len: -1
| | >end_server
| | | info: Socket: 2540
| | | >_myfree
| | | | enter: ptr: 83a33d0
| | | <_myfree
| | | >free_old_query
| | | <free_old_query
| | <end_server
| | error: message: 2013 (Lost connection to MySQL server during query)
| | >end_server

The client (web server) runs on NT.  The mysql db runs on UnixWare
7.0.1.
Versions of myodbc and mysql can be found in the trace above.

Does anyone know what the cause is?

Thanks!
John

Thread
random dropped connections via odbc from asp web pageJohn Pearson20 May
  • ODBC access through firewallDavid Carlson21 May