MySQL Forums
Forum List  »  Connector/ODBC

Re: ODBC error: Lost connection, waiting for communication packet
Posted by: Bogdan Degtyariov
Date: December 16, 2019 12:31AM

Hi Mike,

Most likely you are hitting a timeout issue because the server response did not arrive within expected period of time.

There are three types of timeouts in MySQL ODBC Driver:

1. Login timeout. This timeout can be set using SQLSetConnectAttr() ODBC function.
This timeout corresponds to the number of seconds to wait for a login request
to be completed before returning an error.

Please check the following online manual:
https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlsetconnectattr-function?view=sql-server-ver15

2. Read timeout. This timeout can be set through the connection string
"...;READTIMEOUT=number_of_seconds;"
The option is not available through the GUI Dialog.

READTIMEOUT is the timeout in seconds for each attempt to read from the server.
There are retries if necessary, so the total effective timeout value is three times the option value.
You can set the value so that a lost connection can be detected earlier than the TCP/IP
Close_Wait_Timeout value of 10 minutes.

3. Write timeout. This timeout can be set through the connection string
"...;WRITETIMEOUT=number_of_seconds;"
The option is not available through the GUI Dialog.


The timeout in seconds for each attempt to write to the server.
There is a retry if necessary, so the total effective timeout value is two times the option value.

I hope this helps.

Options: ReplyQuote


Subject
Written By
Posted
Re: ODBC error: Lost connection, waiting for communication packet
December 16, 2019 12:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.