What is the meaning of the MYSQL_OPT_CONNECT_TIMOUT option described in the
online manual in section 22.214.171.124?
Is this a timeout in seconds that mysql_connect will wait while trying to
establish a connection with the server? Or is this the timeout in seconds
for the life of the existing connection? Does this mean if there is no
activity on the connection for the timeout period (selects, inserts, etc.)
then the connection will close? What happens if a query is attempted after
the timeout has caused the connection to close? Will the error code
indicate a timeout, can the connection be restablished safely without
It appears that mysql_ping() can be used to test a connection and cause a
reconnect if it is not active. What is the overhead involved in calling
mysql_ping() versus mysql_connect()? For example, I may want to call
mysql_ping periodically to ensure the connection remains active provided it
has better overhead than mysql_connect().