数据库连接失败信息摘要: ERROR-com.alibaba.druid.pool.DruidDataSource init:927: init datasource error, url: jdbc:Mysql://127.
ERROR-com.alibaba.druid.pool.DruidDataSource init:927: init datasource error, url: jdbc:Mysql://127.0.0.1:3306/pd-mall?useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. Caused by: com.mysql.cj.exceptions.CJException: Data source rejected establishment of connection, message from server: "Too many connections"
该报错总共有两条信息 java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. Caused by: com.mysql.cj.exceptions.CJException: Data source rejected establishment of connection, message from server: "Too many connections" 第一条说的是数据库连接失败 第二条说的是因为连接数太大导致数据库拒绝建立连接
查询数据库最大连接数: 默认是 20select @@max_connections as 'max connections'; 修改数据库最大连接数set global max_connections=120;
mybatis-spring-boot-starter:2.1.3mysql-connector-java:8.0.22本地 mysql 版本: 5.7.30
来源地址:https://blog.csdn.net/m0_46232064/article/details/127083046
--结束END--
本文标题: 数据库连接失败: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
本文链接: https://lsjlt.com/news/374225.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0