Results 1 to 5 of 5

Thread: Connection Unexpectedly Terminated!

  1. #1
    Join Date
    Jan 2009
    Posts
    61

    Connection Unexpectedly Terminated!

    I am having a strange problem with the MySQL Connector .NET 1.0.6. I am trying to develop a .NET (Version 1.1 SP1) application on a Windows 2000
    Professional machine with MySQL Server 4.1.14 version.

    A huge amount of SQL query does execute for about 40 minutes but then cancels with the exception "Connection unexpectedly terminated".

    I don't know waht is wrong in this

    Please provide some views regarding this

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Connection Unexpectedly Terminated!

    try
    {
    // Edit connection settings here!
    MySqlConnection conn = new MySqlConnection( "server=localhost;user
    id=xxx;password=yyy;database=zzz;port=3306" );
    conn.Open();

    // Do a SELECT on a table with many rows here!
    MySqlCommand cmd = new MySqlCommand( "SELECT * FROM xyz LIMIT 1000", conn
    );
    MySqlDataReader reader = cmd.ExecuteReader();

    while ( reader.Read() )
    {
    // Let's sleep for a moment. Important for reproducing the bug!
    Thread.Sleep( 2400 );
    }

    MessageBox.Show( this, "Done" );
    }
    catch( Exception ex )
    {
    MessageBox.Show( this, ex.Message, "Exception!", MessageBoxButtons.OK,
    MessageBoxIcon.Error );
    }

    Since the bug seems to be strongly connected to some timeout, I've tried to
    manipulate several server variables which are related to timeout settings.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Connection Unexpectedly Terminated!

    Could you post your connectionstring?

    Wich version of the Mysql .Net connector are you using?

    Do you get this error always? Can you make an connection by using server explorer and create a new dataconnection?

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Connection Unexpectedly Terminated!

    Stack Trace:
    [HttpException (0x80004005): Request timed out.]

    i have set the connection string with connect timeout 3000.

    surely it shold not take that long

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Connection Unexpectedly Terminated!

    Are you sure you can access that database? Can you access it by some other tool?

    Have you checked that your connecting at the right port? Is there a firewall between?

    I have installed one of the 5.x.x mysql connectors for .Net and i can make a connection from Server Control

    (New connection, and then change type to mysql)

    Have you tried installing a new version of mysql connector?

Similar Threads

  1. Replies: 7
    Last Post: 29-01-2012, 11:11 AM
  2. error “Malwarebyte service terminated unexpectedly”
    By Kaalia in forum Networking & Security
    Replies: 6
    Last Post: 22-12-2011, 07:34 PM
  3. The Print Spooler service terminated unexpectedly.
    By Drewski in forum Windows XP Support
    Replies: 6
    Last Post: 08-08-2011, 05:09 AM
  4. Intellisync - The operation Terminated unexpectedly
    By Agaev in forum Portable Devices
    Replies: 5
    Last Post: 24-07-2010, 06:13 AM
  5. System shutdown due to RPC terminated unexpectedly
    By Hardik in forum Windows XP Support
    Replies: 6
    Last Post: 07-08-2009, 05:12 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,726,859,323.64002 seconds with 17 queries