Mysql 修改最大并发数

09. October 2016 DataBase 0

第一步 找到my.ini 文件

在max_allowed_packet = 1M前面加上max_connections=800,(如果存在则不用添加,直接修改数值即可)

第二步 找到[mysqld]

[mysqld]
port = 3306
socket = mysql
skip-external-locking
key_buffer_size = 384M
max_connections=800
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
thread_concurrency = 8

innodb_buffer_pool_size  (RAM内存的50%~80%):

key_buffer_size = 256M
sort_buffer_size = 256M

数值参考 my-huge.ini,my-large.ini,my-medium.ini,my-small.ini,以及my-innodb-heavy-4G.ini

查看最大连接数用到的命令

show variables like ‘max_connections’;
show variables like ‘%max_con%’;
show processlist

 


Leave a Reply

Your email address will not be published. Required fields are marked *