mysql连接数,druid的连接数
my.ini
// 注册数据库驱动
Class.forName(driver);
DriverManager.getConnection(url, user, password); 按max_connections=1000 的设置,最多可以同时打开1000个。所以使用完成后,就要关闭close。
# The MySQL server
[mysqld]
basedir=""
datadir=""
default-character-set=utf8
default-storage-engine=innodb
max_allowed_packet =12Mwait_timeout=31536000
interactive_timeout=31536000
max_connections=1000port = 3306
socket = MySQL
skip-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 500
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
druid.properties
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/****?characterEncoding=utf-8&serverTimezone=UTC
username=root
password=root
initialSize=5
maxActive=10
maxWait=3000
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!