mysql 问题

Last updated on September 15, 2024 pm

🧙 Questions

☄️ Ideas

too many connection
too many connection

数据库连接占用太多
短时间内创建大量连接,并且没有主动关闭连接,导致连接池太多
还可能数据库主动断开连接时间设置太长,连接一直睡眠导致。

解决方案
-- 查看最大连接数
show variables like 'max_connections';
-- 显示连接池进程
show processlist;
-- 设置最大连接数
set GLOBAL max_connections=2000;
-- 查询各种超时设置
show variables like '%timeout%';
-- 修改等待超时时间
set GLOBAL wait_timeout=3600;
外网无法访问

服务器内部可以访问,外部服务器无法访问

解决方案
use mysql;
select host, user from user;
update user set host = '%' where user = 'root';
update user set host = '%' where user = 'cdh';
flush privileges;
Public Key Retrieval is not allowed
jdbc:mysql://localhost:3306/your_database?useSSL=false&allowPublicKeyRetrieval=true

mysql 问题
https://ispong.isxcode.com/db/mysql/mysql 问题/
Author
ispong
Posted on
April 28, 2021
Licensed under