To modify the maximum number of MySQL connections

Source: Internet
Author: User
Tags cpu usage

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.