How can I see / change MySQL connection timeout settings?
java, mysql
Solution
SET SESSION wait_timeout = 999999;//or anything you want
From mysql command line that will increase the timeout value. To be able to see the value:
SHOW VARIABLES LIKE 'wait_timeout';
Problem
I have a Java program. When I log in, after ~600,000 milliseconds (I actually tried several times, and it is always ~600,000. That is why I think there is somewhere set up a timeout for 600,000 miliseconds.) My database connection crashes and my program no longer works (it always needs to be connected to database). It gives me `Communication link failure` error. I Here are my mysql connection settings: ``` import java.sql.*; import javax.swing.*; public class mysqlconnect { Connection conn = null; public static Connection ConnectDb() { try{ Class.forName("com.mysql.jdbc.Driver"); Connection conn = DriverManager.getConnection("jdbc:mysql://server_name/database_name","user_name","user_password"); return conn; }catch (Exception e) { JOptionPane.showMessageDialog(null, "Cant connect to db"); return null; } } } ``` I tried adding `?autoReconnect=true` & `tcpKeepAlive` to my code, but no luck. Is there any way to go to phpmyadmin and change some setting there (increase the timeout time)?