I am trying to disable the auto reconnect feature in MySQL client by updating the my.cnf
with reconnect=false
in the [client]
section of my.cnf
. So the my.cnf
looks something like this:
[mysqld]
...
interactive_timeout=30
[client]
port=3306
socket=~/dir/mysql.sock
reconnect=false
This is not working. The client times out after 30 secs but reconnects to the server.
While debugging the issue I found that the MySQL client variables are not getting set.
When I ran the <dir of mysql>/bin/mysql --help
, I see that the value of port
, socket
and reconnect
flag is :
./mysql --help
port 0
reconnect TRUE
socket (No default value)
I dont want to set the skip-reconnect
from the command line. I can guess that the client configurations from my.cnf
are not being exported to the client. But i need a definitive solution.
The problem is some times not replicable. There are some machines in which the change in my.cnf
works fine.