Forum Moderators: open

Message Too Old, No Replies

Curious problem reconnecting to mySQL using ASP.

         

Woz

6:23 am on Sep 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No sure if this is a mySQL problem or one with ASP, thought I would start here from the mySQL angle.

I am moving sites from Access to mySQL as the DB, hence need to use ASP on existing sites and alter the scripting where necessary to work with mySQL. Obviously then this is on an MS IIS server.

I have a number of modules working perfectly on the local test server, but when I test them online I run into problems. The first page in a set works fine, but when I select the next page via navigation or similar it hangs and finally returns the error message "Lost connection to MySQL server during query."

I am closing all connections and have checked my code but that seems to be OK. The ODBC Connect version is the same local/online. I have also been hunting online for clues as to the cause and subsequent solution but have so far come up empty handed. I guess we ASP/mySQL type people are in the minority.

Anyone git any ideas/hints/solutions?

Onya
Woz

phranque

9:51 am on Sep 25, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The first page in a set works fine, but when I select the next page via navigation or similar it hangs and finally returns the error message "Lost connection to MySQL server during query."

what do you mean by "The first page in a set"?
i'm guessing that page or those pages are in cache somewhere and you never really accessed the db to begin with.

[edited by: txbakers at 12:37 pm (utc) on Sep. 25, 2007]

Woz

9:57 am on Sep 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>what do you mean by "The first page in a set"?

To clarify, lets say I am pulling a set of records from the database. On the first page I pull the first 10 records and set the navigation links to pull the next 10, following 10, and so on. IE., standard navigation links you would see on any search results page.

When I pull the first 10 records it all works perfectly. When I then click on the navigation link to pull the next 10 records it hangs. If I leave it for a few minutes and refresh it works OK.

Strange.

Onya
Woz

phranque

11:14 am on Sep 25, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



weirder than i thought!
here is the reference manual page for that error [dev.mysql.com] in case you want to try some things...

Woz

11:47 am on Sep 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hehe, that was one of the first plaes I looked phranque.

Onya
Woz

txbakers

12:39 pm on Sep 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One hint is to display the actual query for the failed pages using Response.Write so you can copy that query into a separate tool like mySQL front.

It could be a problem with the query.

Woz

12:48 pm on Sep 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope, not the query, otherwise it would not work on the test server. Also, I get the same problem even if I refresh the same page after it has loaded correctly.

Onya
Woz (running out of hair ...)