MySQL maximum number of connections by default is only 100, when users access to a database with the site or forum, will cause the MySQL service CPU usage increases, and can not provide services.
[[Email protected] ~] #vim/etc/my.cnf
Locate the [MYSQLD] section and add the following line:
set-variable=max_connections=500
Note: This parameter must be added to the [mysqld] configuration section and is not valid elsewhere.
For example a standard MY.CNF configuration file is as follows:
[Mysqld]
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
set-variable=max_connections=500
[Mysql.server]
User=mysql
Basedir=/var/lib
[Safe_mysqld]
Err-log=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid
Then restart the MySQL service.
/etc/init.d/mysqld restart
This article from "Guangzhou, Rain People" blog, please be sure to keep this source http://liulihuan.blog.51cto.com/8018739/1641765
To modify the maximum number of MySQL connections