I use below version of MYSQL in my DB server.
root@XXXXXX-test-server:~# mysql -V
mysql Ver 14.14 Distrib 5.6.16, for debian-linux-gnu (x86_64) using EditLine wrapper
root@XXXXX-test-server:~#
When I close remote connections from server side using KILL command, it is reconnectiong from client side automatically.
Server side:
mysql>
mysql> show processlist;
+----+-----------+----------------------+------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+-----------+----------------------+------+---------+------+-------+------------------+
| 37 | test_user | 192.168.47.130:45042 | NULL | Sleep | 75 | | NULL |
| 39 | root | localhost | NULL | Query | 0 | init | show processlist |
+----+-----------+----------------------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)
mysql>
mysql> kill 37;
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql> show processlist;
+----+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------+---------+------+-------+------------------+
| 39 | root | localhost | NULL | Query | 0 | init | show processlist |
+----+------+-----------+------+---------+------+-------+------------------+
1 row in set (0.00 sec)
mysql>
Client Side:
mysql>
mysql> show databases;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
Connection id: 40
Current database: *** NONE ***
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.01 sec)
mysql>
How do I can disable auto reconnect option for remote connections?
I have tried with adding "reconnect=false" to '[client]' section in my.cnf config file. But it does not work. Still it reconnects from client side automatically.