in reply to DBD::MySQL timeout during query

The DBD::MySQL docs state: "mysql_connect_timeout If your DSN contains the option ``mysql_connect_timeout=##'', the connect request to the server will timeout if it has not been successful after the given number of seconds.

No default value is listed, but I wouldn't be surprised if it was 30 seconds.

Try something like:

$dsn = "DBI:mysql:database=$database;host=$hostname;port=$port;mysql_c +onnect_timeout=60"; $dbh = DBI->connect($dsn, $user, $password);

Replies are listed 'Best First'.
Re^2: DBD::MySQL timeout during query
by tachyon (Chancellor) on Sep 09, 2004 at 00:37 UTC

    The connection timeout would not appear to be relevant in this case as the error (lost connection to database during query) can only occur if you already have a connection. Once you have a connection this timeout is irrelevant. That DBH connection itself will have a life of 8 hours by default (or until you disconnect)

    cheers

    tachyon

Re^2: DBD::MySQL timeout during query
by rcraig (Initiate) on Sep 09, 2004 at 15:11 UTC
    Thanks.
    I pretty sure it's not actually a connect timeout.I did try this tho. The problem is that is loses the connection during the query, and it was certainly connected becuase it executes four queries before it hits the one that takes "too long".
    Thanks again.