本地项目访问服务器的MySQL时,远程连接有效,但是启动no项目是连接数据库是出现com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure错误,可以查看下MySQL日志可能是数据库最大连接超时了。
解决方案:
编辑:vim /etc/my.cnf配置
在[mysqld]区域添加:
wait_timeout=315360000
interactive_timeout=315360000