mysql查看连接数

2,751 阅读1分钟

show variables like '%max_connections%';查看当前最大连接数

set global max_connections=1000重新设置最大连接数

可以在/etc/my.cnf里面设置数据库的最大连接数

[mysqld] max_connections = 1000

show status like 'Threads%'; 里面的threads_connected表示当前连接数,threads_running表示当前并发数