今天今天本来想把MYSQL重新编译一次了,以前的链接数不够。资料都找到放下面了,结果还是有点担心对正常服务造成影响,毕竟是生产服务器,就又找了个不编译直接修改链接数的方法见http://www.9wy.net/archives/92.html,这文章只供参考了,未做。
下载的是5.0版本的源代码,地址http://mirror.provenscaling.com/mysql/enterprise/source/5.0/mysql-5.0.50.tar.gz
修改mysql 客户端最大连接数, 默认的只有100,远远达不到我们的要求。
vi sql/mysqld.cc
搜索找到下面一行:
{“max_connections”, OPT_MAX_CONNECTIONS,
“The number of simultaneous clients allowed.”, (gptr) &max_connections,
(gptr) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 100, 1, 16384, 0, 1,
0},
将其中的100改为1500, 当然小点也可以,根据你的需要来,不建议改的太大。
{“max_connections”, OPT_MAX_CONNECTIONS,
“The number of simultaneous clients allowed.”, (gptr) &max_connections,
(gptr) &max_connections, 0, GET_ULONG, REQUIRED_ARG, 1500, 1, 16384, 0, 1,
0},
保存。
编译参数
./configure –prefix=/usr/local/mysql –localstatedir=/var/lib/mysql –with-comment=Source –with-server-suffix=-enterprise-gpl –with-mysqld-user=mysql –without-debug –with-big-tables –with-charset=utf8 –with-collation=utf8_general_ci –with-extra-charsets=gbk,latin1 –with-pthread –enable-static –with-client-ldflags=-all-static –with-mysqld-ldflags=-all-static –enable-assembler –without-innodb –without-ndb-debug –without-isam –enable-local-infile –with-readline –with-raid