Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

ASP.NET With MySQL - DB Connection Lost

  • 27-09-2006 6:42pm
    #1
    Registered Users, Registered Users 2 Posts: 1,045 ✭✭✭


    Hi,

    I'm currently hosting a couple of ASP.NET sites using MySQL databases with Hosting365.ie and lately I've been getting a lot of errors during database queires. The errors are from the myodbc driver I'm using - 3.51 and say the driver lost it's connection to the MySQL server during the query. The errors are occurring randomly and intermittently but have become much more frequent in the past few weeks.

    I've spoken to HOST365 about this but they claim nothing's changed in the MySQL server configurations and really don't seem very interested in helping me sort out the issue. I'd prefer not to have to move the sites to another provider.

    Anyone with MySQL experience got any ideas what might be going on here?


Comments

  • Registered Users, Registered Users 2 Posts: 1,466 ✭✭✭Smoggy


    I presume ur not on a dedicated server ? I havent used mysql for a while , but I presume it has a maximum amount of concurrent connections. Any of the other users on the server could be using up these connections , leaving ur code to timeout.

    Just a stab in the dark thou.

    edit : The Server manager could have quite easily limited to 20/30/40 connections to conserve resources and someones poor code is using multiple connections and not returning them.

    Can you post the EXACT error , maybe even an error number ?

    Also has your code changed significantly since these errors have started to occur ?


  • Registered Users, Registered Users 2 Posts: 1,361 ✭✭✭ChippingSodbury


    I would think it's most likely too many connections as well. Do a quick test: make a loop to open the connection and close it say 500 times. If you are not closing the connection properly, you'll soon get an error. The provider I use has a limit of 20 MySQL connections per user (I know because I got caught by not closing my connections!).


  • Registered Users, Registered Users 2 Posts: 1,045 ✭✭✭Bluefrog


    Well, the hosting company also suggested the closing connections point so I went though the entire code base and made sure I had shut down the connections each time though I was pretty sure I had cause this code was initially developed with an Access database and it was very unforgiving about connections being left open and sure enough, all were explicitly shut down.

    I got the hosting company to increase the timeout on the server and while that has removed many of these errors it hasn't solved the problem completely. Anyone got any further thoughts on it?

    Anyone got any reommendations for a good windows hosting company (shared) that will support mysql too?

    Here's the error as it appears on the asp.net pages - it's random can appear anywhere.

    SOURCE: myodbc3.dll
    MESSAGE: ERROR [HY000] [MySQL][ODBC 3.51 Driver][mysqld-4.1.21-log]Lost connection to MySQL server during query


Advertisement