Loading
0

MySQL 8 优化

# 查看最大连接数
show variables like '%max_connections%';
# 设置最大连接数
set global max_connections = 16384;
#查看睡眠连接超时
SHOW GLOBAL VARIABLES LIKE '%timeout';
#设置睡眠连接超时
set global wait_timeout=3600;

my.cnf配置:

[mysqld] 
#最大连接数
max_connections=16384
#睡眠连接超时(单位:秒)
wait_timeout=3600
#锁超时
lock_wait_timeout=30

参考:

最后编辑于:2023/7/28作者: joycode

我不入地狱,谁入地狱?

评论已关闭