如何加大mysql连接数
时间:2006-03-12 来源:forestwill
mysql默认安装的最大连接数是100。100一般是不够用的。要增大连接数,要怎样增加呢?
cd /usr/local/share/mysql
这里有mysql配置的模板,有小内存,大内存,超大内存的,
movie# cp my-large.cnf /etc/my.cnf
chmod 600 /etc/my.cnf 现在文件可以写入了 vi /etc/my.cnf [mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
max_connections = 1000 max_connections = 1000 一定要加在[mysqld]这段里面 重启mysql,ok
chmod 600 /etc/my.cnf 现在文件可以写入了 vi /etc/my.cnf [mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
max_connections = 1000 max_connections = 1000 一定要加在[mysqld]这段里面 重启mysql,ok
相关阅读 更多 +