How to set MySQL "wait_timeout" option on Ubuntu
I was trying upload a large database on Ubuntu that kept failing because of connection timeout problem, so I had to take the following steps:
1. To make it easier to find the right .cnf file, create a symbolic link:
ln -s /etc/mysql/mysql.conf.d/mysqld.cnf /etc/my.cnf
2. Paste with nano /etc/my.cnf
[mysqld]
wait_timeout = 31536000
interactive_timeout = 31536000
3. systemctl restart mysql
4. Verify with:
mysql
SELECT @@global.wait_timeout, @@session.wait_timeout;
Add new comment