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 =12M

wait_timeout=31536000
interactive_timeout=31536000
max_connections=1000

port = 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

posted @   古锁阳关  阅读(246)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
点击右上角即可分享
微信分享提示