当前位置:网站首页>【网站小白】mySQL数据库异常断开
【网站小白】mySQL数据库异常断开
2022-08-11 05:14:00 【4576号菜鸟】
【报错】org.hibernate.exception.JDBCConnectionException: could not execute query
【描述】
网站部署好之总是隔一段时间就连不上数据库,报org.hibernate.exception.JDBCConnectionException: could not execute query错误
【原因】
mysql数据库默认连接时是8个小时
如果超过8小时没有与数据库的连接,再次链接数据库就会报这个错误.
【解决】
步骤一:进入数据库,看一下wait_timeout 的值:
Show global variables like 'wait_timeout';
28800 就是8小时
步骤二:修改wait_timeout的值:
Set global wait_timeout=1814400;
步骤三:最后重启tomcat.
边栏推荐
猜你喜欢
随机推荐
MySQL must know and must know (primary articles)
【备忘】从零开始搭建Yolo5训练环境
并发编程之线程基础
Use Adobe genuine software for prostitution to reduce the slow employment and non-employment of fresh graduates
oracle表空间与用户的创建
将double类型的数据转为字符串
lspci 命令使用
分库分表之sharding-proxy
pytorch和tensorflow函数对应表
MySQL数据库管理
玩转mysql之查看mysql版本号
Weekly recommended short video: your commonly used Polaroid, its predecessor turned out to be like this!
2022 building welder (building a special type of work) examination questions and simulation test
第二篇 DS5 Armv8 样例工程报错之GCC编译
Oracle中如何用一个表的数据更新另一个表中的数据_转载
Unity WebGL RuntimeError: integer overflow
[No 2022 Shanghai Security Officer A Certificate Exam Question Bank and Mock Exam
Redis - the solution to the failure of connecting to the redis server in linux using jedis
基础数据之double和float区别
(3) Construction of a real-time performance monitoring platform (Grafana+Prometheus+Node_explorer+Jmeter)











