-
June 28th, 2011, 05:55 PM
#1
Error! 'Mysql server has gone away' even though wait_timeout is 3600
hi, i have a vb6 app that connects to a mysql database online. Everything (connection,save,search and query) works fine but if i leave the form idle for 2 minutes, i receive the error 'My sql server has gone away' .
After surfing, i found out d cause of the error is the wait_timeout value on mysql being low. I checked the wait_timeout value on the mysql database and it is 3600 which means 1 hr. So this means, i shouldnt receive this error until and unless the software is idle for more than an hour. Right ?
But i receive the error if the software remains idle for a minute or so.
For now, i can trap the error and re-connect, but it is very slow and frustrating because every 2 mins i need to do it.
FYI : I m using ado to connect and i have the mysql 3.51 drivers installed.
Please advise. Thanks.
-
June 28th, 2011, 10:29 PM
#2
Re: Error! 'Mysql server has gone away' even though wait_timeout is 3600
Do you know what kind of connection you are using?
The Wait_Timeout applies only to TCP/IP and Unix sockets it does not apply to Named Pipes or shared memory connections.
•wait_timeout
Command-Line Format --wait_timeout=#
Option-File Format wait_timeout
Option Sets Variable Yes, wait_timeout
Variable Name wait_timeout
Variable Scope Global, Session
Dynamic Variable Yes
Permitted Values
Type numeric
Default 28800
Range 1-31536000
Permitted Values
Type (windows) numeric
Default 28800
Range 1-2147483
The number of seconds the server waits for activity on a noninteractive connection before closing it. This timeout applies only to TCP/IP and Unix socket file connections, not to connections made using named pipes, or shared memory.
On thread startup, the session wait_timeout value is initialized from the global wait_timeout value or from the global interactive_timeout value, depending on the type of client (as defined by the CLIENT_INTERACTIVE connect option to mysql_real_connect()). See also interactive_timeout.
Always use [code][/code] tags when posting code.
-
June 29th, 2011, 11:24 AM
#3
Re: Error! 'Mysql server has gone away' even though wait_timeout is 3600
Hi, thanks for the reply. I m not sure what kind of connection it is. I use adodc control and this is the code i have on form load.
Code:
With ado
.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=" & strServerName & _
";DATABASE=" & strDatabaseName & ";" & _
"USER=" & strUserName & _
";PASSWORD=" & strPassword & _
";OPTION=3;"
This is the first time i m using mysql, so my knowledge is very limited. When i go to phpmyadmin on cpanel, it says 'local host via unix socket' and has the mysql version below it.
I m using ado connection and i have a datagrid control on the same form. If the form is idle for sometime, the datagrid's update/delete functions also fail. I m thinking 'ado' has some sort of connection with this. Is there anything i m missing(probably some timeout value for the ado) ?
please advise, sorry for my limited knowledge.
-
June 29th, 2011, 10:00 PM
#4
Re: Error! 'Mysql server has gone away' even though wait_timeout is 3600
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|