mysql timeout connection

时间:2023-03-09 21:59:30
mysql  timeout connection

由于使用阿里云服务器,使用mysql 每当周一的时候客户端首次连,总是报timeout connection 的错误 ,尝试了几个方法没有实际效果。

1.用网上说的URl上缀上autoReconnect=true    jdbc:mysql://localhost:3306/oa?autoReconnect=true。

2.编辑mysql目录里的:my.cnf(windows下为my.ini),

# The TCP/IP Port the MySQL Server will listen on port=3306下面添加

wait_timeout=31536000

interactive_timeout=31536000