MySQL/ASP Intermittent Connection Issues

I began experiencing a troubling problem in my ASP scripts beginning about two months ago. I had not changed anything in my scripts. The problem seems to have popped up on its own and is not limited to one server, but all windows and mysql servers on which my accounts are hosted.

The problem: Every now and then (no detectible pattern), an ASP script will throw a [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'mysqlX.domain.com' (10060). It also occurs when the IP is used in place of mysqlX.domain.com. The error always follow the opening of a new connection to the database server (adoConn.Open strConnectionVar). Whenever I have experienced this error personally, I can click "refresh" and the page loads without issue.

I have googled this over and over. There are plenty of results on a search for the error message that I'm getting, but they don't seem to apply in this case (or I don't understand what I'm reading). I've ping ponged a little with jodohost support, but they say there's nothing wrong with the mysql server.

I've got a few theories:

1) The version of ODBC on the server cannot handle as many connections as are being asked of it, so it's throwing errors when someone tries to connect to the mysql database via script. This theory might hold water if others are experiencing the same errors.

2) There was some kind of update to either ODBC, Windows, or MySQL around the same time as I began getting these errors which has introduced the possibility of these errors.

Things it cannot be:

1) I don't believe it can be a problem with my connection string. I have used the same format for connection string for as long as I have been with Jodohost without issue until lately. Here is my connection string for your scrutiny:

StrConnectionVAR = "Driver={MySQL ODBC 3.51 Driver};server=mysqlX.domain.com;uid=username;pwd=password;database=dbname;Option=16387;"

2)I don't believe it is an overabundance open connections caused by my scripts. At first, I thought this might be the case so i scrubbed my scripts for loose ends. I made a pretty drastic change to the script by opening one database connection per page load. I also made sure that all connections and recordsets are closed by the end of the script.



So sorry for the long post. If you've made it this far, I applaud you. Hopefully, someone out there had experienced something similar. If that's you, let me know what you did to fix it or if you have any advice for me.

Best Regards!
 
using the DSN and ODBC driver is nearly the same, you have my email, cna you send me the server this is happening most on, I will see if I can adjust the obbc connection pool on this one.
 
Thanks, Stephen. The email has been sent. So, it sounds like you believe the errors will cease or reduce if you increase the odbc connection pool on the server. I remember coming across an article on the web that said the same thing. I sure hope it is the solution.

I don't mean to get too far ahead, but if this works, do I need to request an ODBC Connection Pool increase on any servers where I experience this same error?
 
The sites which are logging this kind of error are all using mysql2 right now.

It seems that the number of errors has decreased. I was getting close to 20 mysql connection errors from at least five servers per day. Today, I've only had two errors from one server (mysql2) so far and those two errors were 7 hours apart. However, this decrease could be attributed to less traffic since today is a holiday in the US.
 
What could be the reasons why I'm the only person who seems to be experiencing MySQL connection errors of this type and frequency on JodoHost servers?

As I thought about this, I came up with a couple possible reasons. ANYONE is welcome to chime in with thoughts.

1) I could be using a problematic connection string or method.

2) There could be something that I am doing in my scripts to create an unstable environment for MySQL/ODBC.
 
I have been using an ODBC monitor(logger) to check it, I am doing some logging, I have not forgotten this :)
 
I saw two in logs, one could have slipped by as I was looking at it quickly.

I am trying to see what is happening overall, and of note is that PHP connections are working direct and ASP is going via ODBC layer.
 
If it helps, I did experience a similar connection error in phpbb on one of my sites. It only happened to me once and I only just now remembered it because you mentioned php. When it happened, I assumed that the problem wasn't isolated to ASP. If this is the case, I would naturally get less connection errors in PHP since I use it so very little. BUT, since it only happened to me once, it might have been something totally different.
 
I saw two in logs, one could have slipped by as I was looking at it quickly.

I am trying to see what is happening overall, and of note is that PHP connections are working direct and ASP is going via ODBC layer.

Stephen,

This isn't the same mySQL server that my customer has been having intermittant problems with is it?
 
I think the issue "maybe" due to some bug in MySQL 4.0.27(lastest and last version of 4.0.x series) or some other issue between this release and the PHP's MySQL library for Windows. Anyone having this issue on Linux servers as well?
 
I think the issue "maybe" due to some bug in MySQL 4.0.27(lastest and last version of 4.0.x series) or some other issue between this release and the PHP's MySQL library for Windows.

Was the updates applied about 2 months ago as that was when the problems started?

Gavin
 
I think the issue "maybe" due to some bug in MySQL 4.0.27(lastest and last version of 4.0.x series) or some other issue between this release and the PHP's MySQL library for Windows. Anyone having this issue on Linux servers as well?

Install was done in July.

July would make sense. I began to notice periodic connection errors back in the summer, but I was so busy with non-web projects that I probably missed many opportunities to see what was really going on.

Assuming Tamnya is right about a possible bug in this current version of MySQL, is a roll-back feasible? If it takes away the errors, it certainly would be desirable.

We can rule out a problem exclusively with PHP's MySQL lib because it is happening to me almost exclusively in ASP on Windows servers.

If it's not ASP and it's not PHP and it's not the programmers (since so many experience the same problems) and it's not the servers (so many behave the same), that leaves the connection (which I am clueless about), ODBC, or MySQL itself.

Stephen, I'm sure you're still logging ODBC. Did you see the huge number of connection errors MYSQL2 and MYSQL4 threw today? I actually watched one of our secretaries attempt to access a page today and received 3 connection errors in a row (refreshing 3 times to try to get the page to load). I used to have confidence that a simple refresh would fix everything and the person could move on, but it actually seems like the problem is getting worse.

What are you guys thinking at this point?
 
Back
Top